R01UH0823EJ0100 Rev.1.00
Page 1609 of 1823
Jul 31, 2019
RX23W Group
44. 12-Bit A/D Converter (S12ADE)
Figure 44.23
Scan Conversion Timing (Activated by Asynchronous Trigger)
44.3.7
Usage Example of A/D Data Register Automatic Clearing Function
Setting the ADCER.ACE bit to 1 automatically clears the A/D data registers (ADDRy, ADRD, ADTSDR, ADOCDR,
ADDBLDR) to 0000h when the A/D data registers are read by the CPU, DTC, or DMACA.
The ring buffer (ADBUFn: n = 0 to 15) is not subject to auto-clearing.
This function enables detection of update failures of the A/D data registers (ADDRy, ADRD, ADTSDR, ADOCDR,
ADDBLDR). The following describes the examples in which the function to automatically clear the ADDRy register is
enabled and disabled.
In a case where the ADCER.ACE bit is 0 (automatic clearing disabled), if the A/D conversion result (0222h) is not
written to the ADDRy register for some reason, the old data (0111h) will be the ADDRy value. Furthermore, if this
ADDRy value is read into a general register using an A/D scan end interrupt, the old data (0111h) can be saved in the
general register. When checking whether there is an update failure, it is necessary to frequently save the old data in the
RAM or a general register.
In a case where the ADCER.ACE bit is 1 (automatic clearing enabled), when ADDRy = 0111h is read by the CPU, DTC,
or DMACA, ADDRy is automatically cleared to 0000h. After that, if the A/D conversion result 0222h cannot be
transferred to ADDRy for some reason, the cleared data (0000h) remains as the ADDRy value. If this ADDRy value is
read into a general register using an A/D scan end interrupt at this point, 0000h will be saved in the general register.
Occurrence of an ADDRy update failure can be determined by simply checking that the read data value is 0000h.
44.3.8
A/D-Converted Value Addition/Average Mode
In A/D-converted value addition mode, the same channel is A/D-converted 2, 3, 4, or 16 consecutive times and the sum
of the converted values is stored in the data register. In A/D-converted value average mode, the same channel is A/D-
converted two or four consecutive times and the mean of the converted values is stored in the data register. The use of the
average of these results can improve the accuracy of A/D conversion, depending on the types of noise components that
are present. This function, however, cannot always guarantee an improvement in A/D conversion accuracy.
The A/D-converted value addition or average mode can be specified when A/D conversion of the channel select analog
input, temperature sensor output, or internal reference voltage is selected.
t
DIAG
t
SCAN
t
CONV
t
ED
DIAG conversion
A/D conversion
End
processing
Asynchronous
trigger
(External trigger)
t
D
Waiting
ADST bit
A/D converter