43.7.13 ADC Digital Comparator Control Register

Table 43-18. Register Bit Attribute Legend
Symbol Description Symbol Description Symbol Description
R Readable bit HC Cleared by Hardware (Grey cell) Unimplemented
W Writable bit HS Set by Hardware X Bit is unknown at Reset
K Write to clear S Software settable bit
Name: CMPCTRL
Offset: 0xB0
Reset: 0x00000000
Property: PAC Write-Protected, Enable-Protected

Bit 3130292827262524 
   IEHIHIIEHILOADCMPHI[11:8] 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 
Bit 2322212019181716 
 ADCMPHI[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 15141312111098 
 IEBTWNIELOHIIELOLOCMPENADCMPLO[11:8] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 76543210 
 ADCMPLO[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 

Bit 29 – IEHIHI Enable Comparison - High Limit, Active High

Setting this bit enables comparison events ADCMPHI≤ ADC value.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.

Bit 28 – IEHILO Enable Comparison - High Limit, Active Low

Setting this bit enables comparison events ADC value < ADCMPHI.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.

Bits 27:16 – ADCMPHI[11:0] High limit of Digital Analog Comparator n

This register stores the limit value which is used for comparisons with the ADC Module output data when

IEHIHI = 1, IEHILO = 1, or IEBTWN = 1.

The user is responsible for formatting the data in ADCMPHI[11:0] as signed or unsigned to match the data format as specified by the CHNCFG3n.SIGNk and CHNCFG2n.FRACTk bits for all the analog input channels k which are enabled by CHNCFG1n.CHNCMPENk .

Note: In Filter accumulation mode, the comparison is done on the upper 12 of the 16 bits of filter data.
Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.

Bit 15 – IEBTWN Enable Comparison - Active Between Limits

Setting this bit enables comparison events ADCMPLO ≤ ADC Value < ADCMPHI.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.

Bit 14 – IELOHI Enable Comparison - Low Limit, Active High

Setting this bit enables comparison events ADCMPLO≤ ADC Value.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.
ValueDescription
0 Use normal interrupts
1 use early interrupts

Bit 13 – IELOLO Enable Comparison - Low Limit, Active Low

Setting this bit enables comparison events ADC Value < ADCMPLO.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.

Bit 12 – CMPEN Digital Comparator n Enable

Setting this bit enables digital comparisons for the inputs to ADCn.

For each channel input channel k to ADCn to be compared the corresponding bit CHNCFG1n.CHNCMPENk must be set for the channel to be monitored.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.

Bits 11:0 – ADCMPLO[11:0] Low limit of Digital Analog Comparator

This register stores the limit value which is used for comparisons with the ADC Module output data when

IELOHI = 1, IELOLO = 1, or IEBTWN = 1.

The user is responsible for formatting the data in ADCMPLO[11:0] as signed or unsigned to match the data format as specified by the CHNCFG3n.SIGNk and CHNCFG2n.FRACTk bits for all the analog input channels k which are enabled by CHNCFG1n.CHNCMPENk .

Note: In Filter accumulation mode, the comparison is done on the upper 12 of the 16 bits of filter data.
Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) returns a bus error.
  2. The Digital Comparator works on the final value of the filter data.
  3. When using channel using FRACT (16bits left justified) the lower 4 bits are ‘0, therefor in this mode 15:4 will be in 11:0 and user must account for the lower 4 bits of 0’s.
  4. In any case where the results value is of greater resolution than 12 bits, the comparison is only performed on upper 12 bits of the results value according to the settings of register CMPCTRLn.