NuMicro™ Mini51 Technical Reference ManualFeb 9, 2012 Page 110 of 342 Revision V1.03NUMICRO™ MINI51 TECHNICAL REFERENCE MANUAL ADCMPR1 to monitor the maximum two specified channel conversion results from A/D conversionmodule (refer to Figure 5.6-3). Software can select which channel to be monitored by settingCMPCH (ADCMPRx[5:0]) and CMPCOND bit is used to check if conversion results are less thanthe specified value or greater than (or equal to) the value specified in CMPD[9:0]. When theconversion of the channel specified by CMPCH is completed, the comparing action will betriggered one time automatically. When the compare result meets the setting, compare matchcounter will increase 1; otherwise, the compare match counter will be cleared to “0”. When countervalue reaches the setting of (CMPMATCNT+1) the CMPF bit will be set to “1”. If CMPIE bit is setthen an ADC_INT interrupt request is generated. The detailed logics diagram is shown in Figure5.6-3.10-bitComparator RSLT >=CMPDRSLT < CMPDCMPCOND(ADCMPRx[2])10 CMPFx(ADSR[2:1])A/DanalogmacroChannelAddr.8 to 1AnalogMUXMatchCounterCMPMATCNT(ADCMPRx[11:8])AIN0AIN7……CHANNEL(ADSR[6:4])CMPCH(ADCMPRx[5:3])ADDR[9:0]CMPD(ADCMPRx[25:16])Note:CMPD=ADCMPRx[25:16]RSLT=ADDR[9:0]Figure 5.6-3 A/D Conversion Result Monitor Logics Diagram5.6.4.5 Interrupt SourcesThere are three interrupt sources of ADC interrupt. When an ADC operation mode finishes itsconversion, the A/D conversion end flag, ADF, will be set to “1”. The CMPF0 and CMPF1 are thecompare flags of compare function. When the conversion result meets the settings ofADCMPR0/1, the corresponding flag will be set to “1”. When one of the flags, ADF, CMPF0 andCMPF1, is set to “1” and the corresponding interrupt enable bit, ADIE of ADCR and CMPIE ofADCMPR0/1, is set to “1”, the ADC interrupt will be asserted. Software can clear the flag to revokethe interrupt request.ADFADIECMPF1CMPIE1ADC_INTCMPF0CMPIE0Figure 5.6-4 A/D Controller Interrupt