beautypg.com

3 calibration of the adc – Texas Instruments TLV1562 User Manual

Page 59

background image

Software Overview

53

Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP

8.6.3

Calibration of the ADC

CALIBRAT.ASM

**************************************************************************

* TITLE : TLV1562 ADC Interface routine *

* FILE : CALIBRAT.ASM *

* FUNCTION : CALIBRAT_INTERNAL_MID_SCALE *

* CALIBRAT_SYSTEM_MID_SCALE *

* CALLS : N/A *

* PRECONDITION : N/A *

* POSTCONDITION : N/A *

* SPECIAL COND. : N/A *

* DESCRIPTION : routine to perform a ADC calibration *

* AUTHOR : AAP Application Group, ICKE, Dallas *

* CREATED 1998(C) BY TEXAS INSTRUMENTS INCORPORATED. *

* REFERENCE : TMS320C54x User’s Guide, TI 1997 *

**************************************************************************
.title ”CALIBRAT”

.mmregs

.width 80

.length 55

.version 542

.if (IME_CALIBRATION|SME_CALIBRATION)

.sect ”.data”

CR_CALIBRA .usect ”.variabl”, 1 ; temporary variable, can be changed anywhere during
the program

.sect ”.text”

.if (IME_CALIBRATION)

************************************************************************************

* CALIBRAT_INTERNAL_MID_SCALE

* performs an internal calibration of the ADC to offset for internal device errors

* basic idea: do a error calibration in mono interrupt driven mode using CSTART

* for conversion but use the channel & single/differential input information already

* set-up in the CR0_send register from

************************************************************************************
CALIBRAT_INTERNAL_MID_SCALE:

DP = #AD_DP ; initialize data pointer

* clear calibration related bits in CR0:

@CR0_SEND &= #(NO_CALIB_OP^0FFFFh) ; clear bit for no calibration use

@CR0_SEND &= #(CALIB_OP^0FFFFh) ; clear bit for no calibration use

* initialize the send values to setup the two programmable registers of the ADC to calibrate

data(CR_CALIBRA) = @CR0_SEND ; load help register with CR0 content

* use calibrated mode in the following for conversion

@CR0_SEND |= #CALIB_OP ; set calibration for further use