EasyManua.ls Logo

Freescale Semiconductor MPC5553 - Page 868

Default Icon
1208 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MPC5553/MPC5554 Microcontroller Reference Manual, Rev. 5
Freescale Semiconductor 19-113
The transfer equations for when sampling these reference voltages are:
CAL_RES
75%VREF
= GCC * RAW_RES
75%VREF
+ OCC +2; (5.5.b)
CAL_RES
25%VREF
= GCC * RAW_RES
25%VREF
+ OCC +2; (5.5.c)
Thus;
GCC = (CAL_RES
75%VREF
- CAL_RES
25%VREF
) / (RAW_RES
75%VREF
- RAW_RES
25%VREF
); (5.5.d)
OCC = CAL_RES
75%VREF
- GCC*RAW_RES
75%VREF
– 2
; (5.5.e)
or
OCC = CAL_RES
25%VREF
- GCC*RAW_RES
25%VREF
– 2 ; (5.5.f)
After being calculated, the GCC and OCC values must be written to ADC0_GCCR and ADC1_GCCR
registers (see Section 19.3.3.4) and the ADC0_OCCR and ADC1_OCCR registers (see Section 19.3.3.5)
using write configuration commands.
The eQADC will automatically calibrate the results, according to equation (5.5.a), of every conversion
command that has its CAL bit asserted using the GCC and OCC values stored in the ADC calibration
registers.
19.5.6.1 MAC Configuration Procedure
The following steps illustrate how to configure the calibration hardware, that is, determining the values of
the gain and offset calibration constants, and the writing these constants to the calibration registers. This
procedure should be performed for both ADC0 and ADC1.
1. Convert channel 44 with a command that has its CAL bit negated and obtain the raw, uncalibrated
result for 25%VREF (RAW_RES
25%VREF
).
2. Convert channel 43 with a command that has its CAL bit negated and obtain the raw, uncalibrated
result for 75%VREF (RAW_RES
75%VREF
).
3. Because the expected values for the conversion of these voltages are known (CAL_RES
25%VREF
and CAL_RES
75%VREF
), GCC and OCC values can be calculated from equations (5.5.d) and
(5.5.e) using these values, and the results determined in steps 1 and 2.
4. Reformat GCC and OCC to the proper data formats as specified in Section 19.4.5.4.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 the GCC value to ADCn gain calibration registers (see Section 19.3.3.4) and the OCC value
to ADCn offset calibration constant registers (see Section 19.3.3.5) using write configuration
commands.
19.5.6.2 Example Calculation of Calibration Constants
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 (5.5.d) and (5.5.e), the gain and
offset calibration constants are:
GCC=(12288-4096)/(11592-3798) = 1.05106492-> 1.05102539
1
= 0x4344
OCC=12288-1.05106492*11592 -2 = 102.06-> 102 = 0x0066
1. This calculation is rounded down due to binary approximation.

Table of Contents

Related product manuals