James Reynolds / AD594x Driver
Embed: (wiki syntax)

« Back to documentation index

Calibration_Functions

Calibration_Functions
[Calibration_Block]

Functions

static void __AD5940_ReferenceON (void)
 Turn on High power 1.8V/1.1V reference and 2.5V LP reference.
static uint32_t __AD5940_TakeMeasurement (int32_t *time_out)
 Turn on ADC to sample one SINC2 data.
AD5940Err AD5940_ADCPGACal (ADCPGACal_Type *pADCPGACal)
 Calibrate ADC PGA.
AD5940Err AD5940_LPTIAOffsetCal (LPTIAOffsetCal_Type *pLPTIAOffsetCal)
 Calibrate LPTIA offset.
AD5940Err AD5940_HSTIAOffsetCal (LPTIAOffsetCal_Type *pHSTIAOffsetCal)
 Calibrate HSTIA offset-ongoing.
AD5940Err AD5940_HSRtiaCal (HSRTIACal_Type *pCalCfg, void *pResult)
 Measure HSTIA internal RTIA impedance.
AD5940Err AD5940_LPRtiaCal (LPRTIACal_Type *pCalCfg, void *pResult)
 Measure LPTIA internal RTIA impedance with HSTIA.
AD5940Err AD5940_HSDACCal (HSDACCal_Type *pCalCfg)
 calibrate HSDAC output voltage using ADC.
AD5940Err AD5940_LPDACCal (LPDACCal_Type *pCalCfg, LPDACPara_Type *pResult)
 Use ADC to measure LPDAC offset and gain factor.
AD5940Err AD5940_LFOSCMeasure (LFOSCMeasure_Type *pCfg, float *pFreq)
 Use system clock to measure LFOSC frequency.

Function Documentation

static void __AD5940_ReferenceON ( void   ) [static]

Turn on High power 1.8V/1.1V reference and 2.5V LP reference.

Returns:
return none.

Definition at line 3037 of file ad5940.c.

static uint32_t __AD5940_TakeMeasurement ( int32_t *  time_out ) [static]

Turn on ADC to sample one SINC2 data.

Returns:
return ADCCode.

Definition at line 3062 of file ad5940.c.

AD5940Err AD5940_ADCPGACal ( ADCPGACal_Type pADCPGACal )

Calibrate ADC PGA.

Parameters:
pADCPGACal,:PGA calibration parameters include filter setup and PGA gain.
Returns:
AD5940ERR_OK.

Determine Gain calibration method according to different gain value... and calibration register

AD5940 use formular Output = gain*(input + offset) for calibration. So, the measured results should be divided by gain to get value for offset register.

Definition at line 3087 of file ad5940.c.

AD5940Err AD5940_HSDACCal ( HSDACCal_Type pCalCfg )

calibrate HSDAC output voltage using ADC.

Note:
It acutally calibrates voltage output of excitation buffer.
Parameters:
pCalCfg,:pointer to configuration structure
Returns:
return AD5940ERR_OK if succeeded.

Definition at line 3938 of file ad5940.c.

AD5940Err AD5940_HSRtiaCal ( HSRTIACal_Type pCalCfg,
void *  pResult 
)

Measure HSTIA internal RTIA impedance.

Parameters:
pCalCfg,:pointer to calibration structure.
pResult,:Pointer to a variable that used to store result. If bPolarResult in structure is set, then use type fImpPol_Type otherwise use fImpCar_Type.
Returns:
AD5940ERR_OK if succeed.

Definition at line 3394 of file ad5940.c.

AD5940Err AD5940_HSTIAOffsetCal ( LPTIAOffsetCal_Type pHSTIAOffsetCal )

Calibrate HSTIA offset-ongoing.

Parameters:
pHSTIAOffsetCal,:pointer to configuration.
Returns:
AD5940ERR_OK.

Definition at line 3382 of file ad5940.c.

AD5940Err AD5940_LFOSCMeasure ( LFOSCMeasure_Type pCfg,
float *  pFreq 
)

Use system clock to measure LFOSC frequency.

Note:
Set system clock to external crystal to get a better measurement accuracy. This function use 3 sequences and the start address is specified by parameter.
Parameters:
pCfg,:pointer to structure.
pFreq,:Pointer to a variable that used to store frequency in Hz.
Returns:
AD5940ERR_OK if succeed.

  Sleep wakeup timer running...
  -SLP----WKP----SLP----WKP----SLP----WKP
  --|-----|-------------|-------------|------------Trigger sequencer when Wakeup Timer over.
  --------|SEQA---------|SEQB----------------------Execute SeqA then SeqB
  ---------|InitT--------|StopT--------------------SeqA start timer and SeqB trigger interrupt so MCU read back current count
  ------------------------|INT---------------------
  -----------------------------------------|Read---We read SEQTIMEOUT register here
  ---------|-----TimerCount----------------|-------
  ---------|--------------|---TimerCount2--|-------We change SeqB to reset timer so we measure how much time needed for MCU to read back SEQTIMEOUT register(TimerCount2)

Interrupt flag AFEINTSRC_ENDSEQ will be set after this command. So We can inform MCU to read back current timer value. MCU will need some additional time to read back time count. So we use SeqB to measure how much time needed for MCU to read back

Definition at line 4272 of file ad5940.c.

AD5940Err AD5940_LPDACCal ( LPDACCal_Type pCalCfg,
LPDACPara_Type pResult 
)

Use ADC to measure LPDAC offset and gain factor.

Note:
Assume ADC is accurate enough or accurate than LPDAC at least.
Parameters:
pCalCfg,:pointer to structure.
pResult,:the pointer to save calibration result.
Returns:
AD5940ERR_OK if succeed.

Definition at line 4105 of file ad5940.c.

AD5940Err AD5940_LPRtiaCal ( LPRTIACal_Type pCalCfg,
void *  pResult 
)

Measure LPTIA internal RTIA impedance with HSTIA.

This is the recommended method for LPTIA RTIA calibration.

Parameters:
pCalCfg,:pointer to calibration structure.
pResult,:Pointer to a variable that used to store result. If bPolarResult in structure is set, then use type fImpPol_Type otherwise use fImpCar_Type.
Returns:
AD5940ERR_OK if succeed.

Determine the best ADC PGA gain for both RCAL and RTIA voltage measurement.

Definition at line 3605 of file ad5940.c.

AD5940Err AD5940_LPTIAOffsetCal ( LPTIAOffsetCal_Type pLPTIAOffsetCal )

Calibrate LPTIA offset.

Parameters:
pLPTIAOffsetCalPointer to LPTIA offset calibration settings.
Returns:
AD5940ERR_OK.

Definition at line 3263 of file ad5940.c.