English
Language : 

PXR40RM Datasheet, PDF (1108/1434 Pages) Freescale Semiconductor, Inc – PXR40 Microcontroller
Enhanced Queued Analog-to-Digital Converter (EQADC)
27.8.6 ADC Result Calibration
The ADC result calibration process consists of two steps: determining the gain and offset calibration
constants, and calibrating the raw results generated by the on-chip ADCs by solving the following equation
discussed in Section 27.7.6.6, ADC Calibration Feature.
CAL_RES = GCC * RAW_RES + OCC+2;
Eqn. 27-1
The calibration constants GCC and OCC can be calculated from equation Equation 27-1 provided that two
pairs of expected (CAL_RES) and measured (RAW_RES) result values are available for two different
input voltages. Most likely calibration points to be used are 25% VREF1 and 75% VREF since they are far
apart but not too close to the end points of the full input voltage range. This allows for calculations of more
representative calibration constants. The EQADC provides these voltages via channel numbers 43 and 44.
The raw, uncalibrated results for these input voltages are obtained by converting these channels with
conversion commands that have the CAL bit negated.
The transfer equations for when sampling these reference voltages are:
CAL_RES75%VREF = GCC * RAW_RES75%VREF + OCC+2;
CAL_RES25%VREF = GCC * RAW_RES25%VREF + OCC+2;
Thus;
GCC = (CAL_RES75%VREF – CAL_RES25%VREF) / (RAW_RES75%VREF – RAW_RES25%VREF);
OCC = CAL_RES75%VREF – GCC*RAW_RES75%VREF – 2;
or
Eqn. 27-2
Eqn. 27-3
OCC = CAL_RES25%VREF – GCC*RAW_RES25%VREF – 2;
Eqn. 27-4
After being calculated, the GCC and OCC values must be written to ADC registers: Section 27.6.3.4,
ADC0/1 Gain Calibration Constant Registers (ADC0_GCCR and ADC1_GCCR), and Section 27.6.3.5,
ADC0/1 Offset Calibration Constant Registers (ADC0_OCCR and ADC1_OCCR), using write
configuration commands.
The EQADC will automatically calibrate the results, according to equation Equation 27-1, of every
conversion command that has its CAL bit asserted using the GCC and OCC values stored in the ADC
calibration registers.
27.8.6.1 MAC Configuration Procedure
The following steps illustrate how to configure the calibration hardware, namely, determining the values
of the gain and offset calibration constants, and the writing of these constants to the calibration registers.
The procedure below should be performed for ADC0 and for ADC1.
1. Convert channel 44 with a command that has its CAL bit negated and obtain the raw, uncalibrated
result for 25%VREF (RAW_RES25%VREF).
1. VREF=VRH-VRL
27-126
PXR40 Microcontroller Reference Manual, Rev. 1
Freescale Semiconductor