English
Language : 

PXR40RM Datasheet, PDF (1109/1434 Pages) Freescale Semiconductor, Inc – PXR40 Microcontroller
Enhanced Queued Analog-to-Digital Converter (EQADC)
2. Convert channel 43 with a command that has its CAL bit negated and obtain the raw, uncalibrated
result for 75%VREF (RAW_RES75%VREF).
3. Since the expected values for the conversion of these voltages are known (CAL_RES25%VREF and
CAL_RES75%VREF), GCC and OCC values can be calculated from equations Equation 27-2 and
Equation 27-3 using these values, and the ones determined in steps 1 and 2.
4. Reformat GCC and OCC to the proper data formats as specified in Section 27.7.6.6.2, MAC Unit
and Operand Data Format. GCC is an unsigned 15-bit fixed point value and OCC is a signed 14-bit
value.
5. Write GCC value to Section 27.6.3.4, ADC0/1 Gain Calibration Constant Registers (ADC0_GCCR
and ADC1_GCCR), and OCC value to Section 27.6.3.5, ADC0/1 Offset Calibration Constant
Registers (ADC0_OCCR and ADC1_OCCR), using write configuration commands.
27.8.6.2 Example
The raw results obtained when sampling reference voltages 25%VREF and 75%VREF were, respectively,
3798 and 11592. The results that should have been obtained from the conversion of these reference
voltages are, respectively, 4096 and 12288. Therefore, using equations Equation 27-2 and Equation 27-3,
the gain and offset calibration constants are:
GCC=(12288-4096)/(11592-3798) = 1.05106492-> 1.05102539 = 0x4388
OCC=12288 - 1.05106492*11592 - 2 = 102.06-> 102 = 0x0066
Table 27-48 shows, for this particular case, examples of how the result values change according to GCC
and OCC when result calibration is executed (CAL=1) and when it is not (CAL=0).
Table 27-48. Calibration example
Input Voltage
25% VREF
75% VREF
Raw result (CAL=0)
Hexadecimal
0x0ED6
0x2D48
Decimal
3798
11592
Calibrated result (CAL=1)
Hexadecimal
0x1000
0x3000
Decimal
4095.794
12287.486
27.8.6.3 Quantization Error Reduction During Calibration
Figure 27-77 shows how the ADC transfer curve changes due to the addition of two to the MAC output
during the calibration - see MAC output equation at Section 27.7.6.6.1, Overview. The maximum absolute
quantization error is reduced by half leading to an increase in accuracy.
Freescale Semiconductor
PXR40 Microcontroller Reference Manual, Rev. 1
27-127