158
CHAPTER 13 A/D CONVERTER
13.4.3 A/D converter operation mode
The operation mode of the A/D converter is the select mode. One analog input channel is selected from among
ANI0 to ANI4 with the analog input channel specification register (ADS1) and A/D conversion is performed.
The following two types of functions can be selected by setting the PFEN flag of the PFM register.
(1) Normal 8-bit A/D converter (PFEN = 0)
(2) Power-fail detection function (PFEN = 1)
(1) A/D conversion (when PFEN = 0)
When bit 7 (ADCS1) of the A/D converter mode register (ADM1) is set to 1 and bit 7 of the power-fail compare
mode register (PFM) is set to 0, A/D conversion of the voltage applied to the analog input pin specified with the
analog input channel specification register (ADS1) starts.
Upon the end of the A/D conversion, the conversion result is stored in the A/D conversion result register (ADCR1),
and the interrupt request signal (INTAD) is generated. After one A/D conversion operation is started and ended,
the next conversion operation is immediately started. A/D conversion operations are repeated until new data
is written to ADS1.
If ADS1 is rewritten during A/D conversion operation, the A/D conversion operation under execution is stopped,
and A/D conversion of a newly selected analog input channel is started.
If data with ADCS1 set to 0 is written to ADM1 during A/D conversion operation, the A/D conversion operation
stops immediately.
(2) Power-fail detection function (when PFEN = 1)
When bit 7 (ADCS1) of the A/D converter mode register (ADM1) and bit 7 (PFEN) of the power-fail compare mode
register (PFM) are set to 1, A/D conversion of the voltage applied to the analog input pin specified with the analog
input channel specification register (ADS1) starts.
Upon the end of the A/D conversion, the conversion result is stored in the A/D conversion result register (ADCR1),
compared with the value of the power-fail compare threshold value register (PFT), and INTAD is generated under
the condition specified by the PFCM flag of the PFM register.
Caution
When executing power-fail comparison, the interrupt request signal (INTAD) is not gener-
ated on completion of the first conversion after ADCS1 has been set to 1. INTAD is valid
from completion of the second conversion.
Содержание mPD780973 Series
Страница 2: ...2 MEMO ...
Страница 66: ...66 MEMO ...
Страница 98: ...98 MEMO ...
Страница 138: ...138 MEMO ...
Страница 164: ...164 MEMO ...
Страница 182: ...182 MEMO ...
Страница 204: ...204 MEMO ...
Страница 244: ...244 MEMO ...
Страница 262: ...262 MEMO ...
Страница 278: ...278 MEMO ...
Страница 290: ...290 MEMO ...