13.4.39 ADC Digital Comparator x Control Register (x = 0, 1, 2, 3)

Legend: HC = Hardware Clearable bit; HS = Hardware Settable bit; HSC = Hardware Settable/Clearable bit

Name: ADCMPxCON
Offset: 0xBA0, 0xBA4, 0xBA8, 0xBAC

Bit 15141312111098 
    CHNL[4:0] 
Access HSC/RHSC/RHSC/RHSC/RHSC/R 
Reset 00000 
Bit 76543210 
 CMPENIESTATBTWNHIHIHILOLOHILOLO 
Access R/WR/WHS/HC/RR/WR/WR/WR/WR/W 
Reset 00000000 

Bits 12:8 – CHNL[4:0] Input Channel Number bits

ValueDescription
11111 AN31
11110 AN30
11101 Band Gap, 1.2V (AN29)
11100 Temperature Sensor (AN28)
11011 VDD Core (AN27)
11010 AN26
. . .
00000

AN0

Bit 7 – CMPEN Comparator Enable bit

ValueDescription
1

Comparator is enabled

0

Comparator is disabled and the STAT status bit is cleared

Bit 6 – IE Comparator Common ADC Interrupt Enable bit

ValueDescription
1 Common ADC interrupt will be generated if the comparator detects a comparison event instead of digital comparator interrupt
0 ADC interrupt will not be generated for the comparator

Bit 5 – STAT Comparator Event Status bit

This bit is cleared by hardware when the channel number is read from the CHNL[4:0] bits.

ValueDescription
1 A comparison event has been detected since the last read of the CHNL[4:0] bits
0 A comparison event has not been detected since the last read of the CHNL[4:0] bits

Bit 4 – BTWN Between Low/High Comparator Event bit

ValueDescription
1

Generates a comparator event when ADCMPxLO ≤ ADCBUFx < ADCMPxHI

0

Does not generate a digital comparator event when ADCMPxLO ≤ ADCBUFx < ADCMPxHI

Bit 3 – HIHI High/High Comparator Event bit

ValueDescription
1

Generates a digital comparator event when ADCBUFx ≥ ADCMPxHI

0

Does not generate a digital comparator event when ADCBUFx ≥ ADCMPxHI

Bit 2 – HILO High/Low Comparator Event bit

ValueDescription
1

Generates a digital comparator event when ADCBUFx < ADCMPxHI

0

Does not generate a digital comparator event when ADCBUFx < ADCMPxHI

Bit 1 – LOHI Low/High Comparator Event bit

ValueDescription
1

Generates a digital comparator event when ADCBUFx ≥ ADCMPxLO

0

Does not generate a digital comparator event when ADCBUFx ≥ ADCMPxLO

Bit 0 – LOLO Low/Low Comparator Event bit

ValueDescription
1

Generates a digital comparator event when ADCBUFx < ADCMPxLO

0

Does not generate a digital comparator event when ADCBUFx < ADCMPxLO