SLAU929 April 2024 MSPM0C1104 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0L1105 , MSPM0L1227 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1304 , MSPM0L1305 , MSPM0L1306 , MSPM0L2227 , MSPM0L2228 , MSPM0L2228-Q1
The Microchip 8-bit AVR MCU family and MSPM0 family of parts both offer integrated comparators as optional peripherals on some devices. In the MSPM0 family, comparators are denoted as COMPx, where the 'x' final character refers to the specific comparator module being considered. The ATmega family feature a single comparator with one pair of inputs, whereas the ATtiny family feature up to three pair of inputs. The MSPM0 comparator module provides a windowed comparator functionality using its DAC with two programmable levels. Both MSPM0 and AVR have multiple channels that can take inputs from various internal and external sources, and can be used to trigger changes in power mode or truncate/control PWM signals. A summary of how the MSPM0 and AVR comparator modules compare feature-by-feature is included in Table 5-3.
Feature | ATmega | ATtiny | MSPM0G | MSPM0L |
---|---|---|---|---|
Available comparators | 1 | 1 | Up to 3 | 1 |
Number of positive and negative inputs |
1 pos, 1 neg | Up to 4 pos, 3 neg | Up to 4 pos, 3 neg | Up to 2 pos, 2 neg |
Output routing | No | Multiplexed I/O Pins | Multiplexed I/O Pins | Multiplexed I/O Pins |
Interrupt | Interrupt/Event Interface | Interrupt/Event Interface | Interrupt/Event Interface | |
Noninverting input sources | 1 pos | Multiplexed I/O Pins | Multiplexed I/O Pins | Multiplexed I/O Pins |
DAC12 output(1) | DAC8 output | |||
DAC8 output | OPA1 Output(2) | |||
Internal VREF: 1.4 V and 2.5 V | ||||
OPA1 output(2) | ||||
Inverting input sources | Multiplexed I/O Pins | Multiplexed I/O Pins | Multiplexed I/O pins | Multiplexed I/O Pins |
No | No | Internal temperature sensor | Internal temperature sensor | |
Bandgap: 1.1V | Internal VREF: 1.024V, 2.056V, 2.500, 4.096 and VDD | Internal VREF: 1.4V and 2.5V | DAC8 output | |
No | DAC8 output | DAC8 output | OPA0(3) output | |
No | No | OPA0 output (3) | ||
Programmable hysteresis | No | None, small, medium, large | None, 10mV, 20mV, 30mV | None, 10mV, 20mV, 30mV |
No | Other values from 0V to VREF/VDD using DAC8 | Other values from 0V to VDD using DAC8 | ||
Register lock | No | No | Yes, some COMP registers (writes require key) | Yes, some COMP registers (writes require key) |
Window comparator configuration | No | No | Yes | No (single COMP) |
Input short mode | No | No | Yes | Yes |
Operating modes | No | Active, low power | High speed, low power | High speed, low power |
Fast PWM shutdowns | No | No | Yes (through TIMA fault handler) | No |
Output filtering | No | No | Blanking filter | Blanking filter |
Adjustable analog filter | Adjustable analog filter | |||
Output polarity control | No | Yes | Yes | Yes |
Interrupts | Rising edge | Rising edge | Rising edge | Rising edge |
Falling edge | Falling edge | Falling edge | Falling edge | |
Both edges | Both edges | Output ready | Output ready | |
Exchange inputs mode | No | No | Yes | Yes |
Information about COMP code examples can be found in the MSPM0 SDK examples guide.