
210
CHAPTER 11
A/D CONVERTER
User’s Manual U12790EJ2V0UD
(2) Power-fail comparison mode
In the power-fail comparison mode, the digital value converted from an analog input is compared in units of
8 bits.
If the result of the comparison matches the condition set by bit 6 (PFCM3) of power-fail comparison mode
register 3 (PFM3), an interrupt request (INTAD) is generated.
Note that the power-fail comparison mode can be used in the HALT mode. At this time, the HALT mode can
be released by generating the interrupt request signal (INTAD) as a result of comparison (however, the
A/D operation must be executed before the HALT instruction is executed).
To set the power-fail comparison mode, set bit 7 (PFEN3) of PFM3 to 1, set bit 6 (PFCM3) to the generation
condition of INTAD, and assign the threshold value to be compared with the value of A/D conversion result
register 3 (ADCR3) to power-fail comparison threshold value register 3 (PFT3).
By setting bit 7 (ADCS3) of A/D converter mode register 3 (ADM3) to 1, the voltage applied to the analog input
pin specified by ADS3 is converted into a digital signal. When A/D conversion has been completed, the result
of the conversion is stored in ADCR3. This conversion result is compared with the value set in PFT3 and if
the result of the comparison matches the condition set by bit 6 (PFCM3) of PFM3, an interrupt request signal
(INTAD) is generated.
Figure 11-8. Power-Fail Comparison Threshold Value Register 3 (PFT3)
Remark
Bit 7 (PFT37) is the MSB, and bit 0 (PFT30) is the LSB.
For the setting value, refer to 11.4.2 Input voltage and conversion results.
Cautions 1. In the power-fail comparison mode, the first result (A/D conversion result and interrupt
request (INTAD)) of the A/D conversion (started by setting bit 7 (ADCS3) of A/D converter
mode register 3 (ADM3) to 1) is not correct.
2. When executing A/D conversion in the HALT mode using the power-fail HALT repeat
mode, clear the interrupt request flag (ADIF) after the first conversion has been completed
immediately after bit 7 (ADCS3) of ADM3 has been set to 1, and bit 5 (PFHRM3) of power-
fail comparison mode register 3 (PFM3) has been set to 1, before executing the HALT
instruction.
3. To set the power-fail comparison mode in the HALT mode, be sure to set bit 5 (PFHRM3)
of PFM3 to 1 before executing the HALT instruction. Otherwise, comparison cannot be
performed correctly because the conversion result in the HALT mode is not stored in
A/D conversion result register 3 (ADCR3). If bit 5 (PFHRM3) of PFM3 is set in the normal
operating mode (other than during HALT operation), the A/D conversion is not performed
correctly. Therefore, be sure to clear this bit to 0 in the normal mode.
Symbol
PFT3
7
PFT37
6
PFT36
5
PFT35
4
PFT34
3
PFT33
2
PFT32
1
PFT31
0
PFT30
R/W
After reset
00H
Address
FF15H