14.3.34 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-11100 Reserved
11011 AN27
11010 AN26
11001 Band gap, 1.2V (AN25)
11000 Temperature sensor (AN24)
10111 AN23
. . .
00010 AN2
00001

AN1

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