SLAZ741D March 2023 – August 2025 MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1305 , MSPM0L1306 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346
COMP Module
Functional
Comparator output will set the rising and falling interrupt when comparator is enabled
Comparator will set the rising and falling when the comparator is enabled.
1. Clear the CPU interrupts by using ICLR bit.
ICLR will not work for clearing generic events. Follow below steps to clear COMP generic events (below are DriverLib functions, you can see the bits manipulation by looking in the function contents in our MSPM0 SDK)
a. Before COMP is enabled, configure COMP publisher with some dummy ID.
DL_COMP_setPublisherChanID(COMP_0_INST, 0); // remove the actual publisher
b. DL_COMP_enableEvent(COMP_0_INST, (DL_COMP_EVENT_OUTPUT_EDGE)); // Enable the COMP events in IMASK
c. DL_COMP_enable(COMP_0_INST); // Enable the COMP module, this step clearing the events in RIS.
d. DL_COMP_disableEvent(COMP_0_INST, (DL_COMP_EVENT_OUTPUT_EDGE));// Disable the COMP events by clearing in IMASK
e. DL_COMP_setPublisherChanID(COMP_0_INST, COMP_0_INST_PUB_CH); // configure the actual publisher
f. DL_COMP_enableEvent(COMP_0_INST, (DL_COMP_EVENT_OUTPUT_EDGE)); // Re-enable COMP events in IMASK
Or
Read the interrupt after the comparator is enabled, knowing that the first interrupt happened due to comparator being enabled.