English
Language : 

EVAL-ADUC831QSZ Datasheet, PDF (26/76 Pages) Analog Devices – MicroConverter®, 12-Bit ADCs and DACs with Embedded 62 kBytes Flash MCU
ADuC831
INITIATING CALIBRATION IN CODE
When calibrating the ADC, using ADCCON1 the ADC should
be set up into the configuration in which it will be used. The
ADCCON3 register can then be used to set the device up and
calibrate the ADC offset and gain.
MOV ADCCON1,#08CH
;ADC on; ADCCLK set
;to divide by 16, 4
;acquisition clock
To calibrate device offset:
MOV ADCCON2,#0BH
MOV ADCCON3,#25H
To calibrate device gain:
;select internal AGND
;select offset calibration,
;31 averages per bit,
;offset calibration
MOV ADCCON2,#0CH
MOV ADCCON3,#27H
;select internal VREF
;select offset calibration,
;31 averages per bit,
;offset calibration
To calibrate system offset:
Connect system AGND to an ADC channel input (0).
MOV ADCCON2,#00H
MOV ADCCON3,#25H
;select external AGND
;select offset calibration,
;31 averages per bit
To calibrate system gain:
Connect system VREF to an ADC channel input (1).
MOV ADCCON2,#01H
MOV ADCCON3,#27H
;select external VREF
;select offset calibration,
;31 averages per bit,
;offset calibration
The calibration cycle time, TCAL, is calculated by the following
equation assuming a 16 MHz crystal:
TCAL = 14 × ADCCLK × NUMAV × (16 + TACQ )
For an ADCCLK/FCORE divide ratio of 16, a TACQ = 4 ADCCLK,
NUMAV = 15, the calibration cycle time is:
TCAL = 14 × (1/1000000) × 15 × (16 + 4)
TCAL = 4.2 ms
In a calibration cycle the ADC busy flag (Bit 7), instead of
framing an individual ADC conversion as in normal mode, will
go high at the start of calibration and only return to zero at the
end of the calibration cycle. It can therefore be monitored in
code to indicate when the calibration cycle is completed. The
following code can be used to monitor the BUSY signal during
a calibration cycle:
WAIT:
MOV A, ADCCON3
JB ACC.7, WAIT
;move ADCCON3 to A
;If Bit 7 is set jump to
WAIT else continue
–26–
REV. 0