Analog-to-Digital Converter (ADC)
907
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
Analog Subsystem
10.3.9.1 Factory Settings and Calibration Function
During the fabrication and test process Texas Instruments calibrates several ADC settings along with a
couple of internal oscillator settings. These settings are embedded into the TI reserved OTP memory as
part of a C-callable function named Device_cal(). This function writes the factory settings into their
respective active registers. Until this occurs, the ADC and the internal oscillators will not adhere to their
specified parameters. The user must ensure the trim settings are written to their respective registers to
ensure the ADC and the internal oscillators meet the specifications in the datasheet. This can be done
either by calling this function manually or in the application itself, or by a direct write via CCS. A gel
function is provided as part of the controlSUITE™ to accomplish this.
Texas Instruments cannot guarantee the parameters specified in the datasheet if a value other than the
factory settings contained in the TI reserved OTP memory is written into the ADC trim registers.
10.3.9.2 ADC Zero Offset Calibration
Zero offset error is defined as the resultant digital value that occurs when converting a voltage at
VREFLO. This base error affects all conversions of the ADC and together with the full scale gain and
linearity specifications, determine the DC accuracy of a converter. The zero offset error can be positive,
meaning that a positive digital value is output when VREFLO is presented, or negative, meaning that a
voltage higher than a one step above VREFLO still reads as a digital zero value. To correct this error, the
two's complement of the error is written into the ADCOFFTRIM register. The value contained in this
register will be applied before the results are available in the ADC result registers. This operation is fully
contained within the ADC core, so the timing for the results will not be affected and the full dynamic range
of the ADC will be maintained for any trim value. Calling the Device_cal() function writes the
ADCOFFTRIM register with the factory calibrated offset error correction, but the user can modify the
ADCOFFTRIM register to compensate for additional offset error induced by the application environment.
This can be done without sacrificing an ADC channel by using the VREFLOCONV bit in the ADCCTRL1
register.
Use the following procedure to re-calibrate the ADC offset:
1.
Set ADCOFFTRIM to 80 (50h)
. This adds an artificial offset to account for negative offset that may
reside in the ADC core.
2.
Set ADCCTL1.VREFLOCONV to 1.
This internally connects VREFLO to input channel B5. See the
register description for more details.
3.
Perform multiple conversions on B5 (sample VREFLO) and take an average to account for
board noise.
See
on how to setup and initiate the ADC to sample B5.
4.
Set ADCOFFTRIM to 80 (50h) minus the average obtained in step 3.
This removes the artificial
offset from step 1 and creates a two's compliment of the offset error.
5.
Set ADCCTL1.VREFLOCONV to 0.
This connects B5 back to the external ADCINB5 input pin.
NOTE:
The "AdcOffsetSelfCal()" function located in F28M35x_Adc.c in the common header files
performs these steps.
10.3.9.3 ADC Full Scale Gain Calibration
Gain error occurs as an incremental error as the voltage input is increased. Full scale gain error occurs at
the maximum input voltage. As in offset error, gain error can be positive or negative. A positive full scale
gain error means that the full scale digital result is reached before the maximum voltage is input. A
negative full scale error implies that the full digital result will never be achieved. The calibration function
Device_cal() writes a factory trim value to correct the ADC full scale gain error into the ADCREFTRIM
register. This register should not be modified after the Device_cal() function is called.
10.3.9.4 ADC Bias Current Calibration
To further increase the accuracy of the ADC, the calibration function Device_cal() also writes a factory trim
value to an ADC register for the ADC bias currents. This register should not be modified after the
Device_cal() function is called.