![](http://datasheet.mmic.net.cn/370000/P9S12XEP100J1VVLR_datasheet_16728329/P9S12XEP100J1VVLR_534.png)
Chapter 13 Analog-to-Digital Converter (ADC12B16CV1) Block Description
MC9S12XE-Family Reference Manual , Rev. 1.07
534
Freescale Semiconductor
13.3.2.12 ATD Conversion Result Registers (ATDDR
n
)
The A/D conversion results are stored in 16 result registers. Results are always in unsigned data
representation. Left and right justification is selected using the DJM control bit in ATDCTL5.
If automatic compare of conversions results is enabled (CMPE[
n
]=1 in ATDCMPE), these registers must
be written with the compare values in left or right justified format depending on the actual value of the
DJM bit. In this case, as the ATDDR
n
register is used to hold the compare value, the result will not be
stored there at the end of the conversion but is lost.
Read: Anytime
Write: Anytime
NOTE
Forconversionsnotusingautomaticcompare,resultsarestoredintheresult
registersaftereachconversion.InthiscaseavoidwritingtoATDDRnexcept
for initial values, because an A/D result might be overwritten.
13.3.2.12.1
Left Justified Result Data (DJM=0)
13.3.2.12.2
Right Justified Result Data (DJM=1)
Table 13-15
shows how depending on the A/D resolution the conversion result is transferred to the ATD
result registers. Compare is always done using all 12 bits of both the conversion result and the compare
value in ATDDRn.
Module Base +
0x0010 = ATDDR0, 0x0012 = ATDDR1, 0x0014 = ATDDR2, 0x0016 = ATDDR3
0x0018 = ATDDR4, 0x001A = ATDDR5, 0x001C = ATDDR6, 0x001E = ATDDR7
0x0020 = ATDDR8, 0x0022 = ATDDR9, 0x0024 = ATDDR10, 0x0026 = ATDDR11
0x0028 = ATDDR12, 0x002A = ATDDR13, 0x002C = ATDDR14, 0x002E = ATDDR15
15
14
13
12
11
10
9
8
7
6
5
4
3
0
2
0
1
0
0
0
R
W
Bit 11 Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Figure 13-14. Left justified ATD conversion result register (ATDDR
n
)
Module Base +
0x0010 = ATDDR0, 0x0012 = ATDDR1, 0x0014 = ATDDR2, 0x0016 = ATDDR3
0x0018 = ATDDR4, 0x001A = ATDDR5, 0x001C = ATDDR6, 0x001E = ATDDR7
0x0020 = ATDDR8, 0x0022 = ATDDR9, 0x0024 = ATDDR10, 0x0026 = ATDDR11
0x0028 = ATDDR12, 0x002A = ATDDR13, 0x002C = ATDDR14, 0x002E = ATDDR15
15
0
14
0
13
0
12
0
11
10
9
8
7
6
5
4
3
2
1
0
R
W
Bit 11 Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bi1 1
Bit 0
Reset
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Figure 13-15. Right justified ATD conversion result register (ATDDR
n
)