Datasheet
www.ti.com
Supported Tags
In the example:
1. 0x0100 × 0x0002 = 0x0200
2. 0x0200 × 0x7BBB = 0x00F7_7600
3. 0x00F7_7600 ÷ 0x0001_0000 = 0x0000_00F7 (= 247)
The code example using the hardware multiplier follows.
; The ADC conversion result is stored in ADC12MEM0
; It is assumed that R9 contains the address of the
; TAG_ADC12_1.
; The corrected value is available in ADC_COR
MOV.W &ADC12MEM0,R10 ; move result to R10
RLA.W R10 ; R10 x 2
MOV.W R10,&MPY ; unsigned multiply OP1
MOV.W CAL_ADC_15VREF_FACTOR(R9),&OP2
; calibration value OP2
MOV.W &RESHI,&ADC_COR ; result: upper 16-bit MPY
24.2.2.4 Offset and Gain Calibration Data
The offset of the ADC12 is determined and stored as a twos-complement number in SegmentA. The offset
error correction is done by adding the CAL_ADC_OFFSET to the conversion result.
ADC(offset_corrected) = ADC(raw) + CAL_ADC_OFFSET
The gain of the ADC12, stored at offset 0x00, is calculated by the following equation.
CAL_ADC_GAIN_FACTOR = (1 / GAIN) × 2
15
The conversion result is gain corrected by multiplying it with the CAL_ADC_GAIN_FACTOR and dividing
the result by 2
15
.
ADC(gain_corrected) = ADC(raw) × CAL_ADC_GAIN_FACTOR × (1 / 2
15
)
If both gain and offset are corrected, the gain correction is done first.
ADC(gain_corrected) = ADC(raw) × CAL_ADC_GAIN_FACTOR × (1 / 2
15
)
ADC(final) = ADC(gain_corrected) + CAL_ADC_OFFSET
24.2.2.5 Example Using Gain and Offset Calibration
In the following example, an external reference voltage is used during a conversion.
• Conversion result: 0x0800 (= 2048)
• Gain calibration factor: 0x7FE0 (gain error: +2 LSB)
• Offset calibration: 0xFFFE (2s complement of -2)
The following steps show an example of how the ADC12 conversion result is corrected by using the
hardware multiplier:
1. Multiply the conversion result by 2 (this step simplifies the final division).
2. Multiply the result by CAL_ADC_GAIN_FACTOR.
3. Divide the result by 2
16
(use the upper word of the 32-bit multiplication result RESHI)
4. Add CAL_ADC_OFFSET to the result.
In the example:
1. 0x0800 × 0x0002 = 0x1000
2. 0x1000 × 0x8010 = 0x0801_0000
3. 0x0801_0000 ÷ 0x0001_0000 = 0x0000_0801 (= 2049)
4. 0x801 + 0xFFFE = 0x07FF (= 2047)
The code example using the hardware multiplier follows.
; The ADC conversion result is stored in ADC12MEM0
; It is assumed that R9 contains the address of the TAG_ADC12_1.
585
SLAU144J–December 2004–Revised July 2013 TLV Structure
Submit Documentation Feedback
Copyright © 2004–2013, Texas Instruments Incorporated