Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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] |
| static uint32_t __AD5940_TakeMeasurement | ( | int32_t * | time_out ) | [static] |
| 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.
| AD5940Err AD5940_HSDACCal | ( | HSDACCal_Type * | pCalCfg ) |
| 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.
| AD5940Err AD5940_HSTIAOffsetCal | ( | LPTIAOffsetCal_Type * | pHSTIAOffsetCal ) |
| 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
| AD5940Err AD5940_LPDACCal | ( | LPDACCal_Type * | pCalCfg, |
| LPDACPara_Type * | pResult | ||
| ) |
| 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.
| AD5940Err AD5940_LPTIAOffsetCal | ( | LPTIAOffsetCal_Type * | pLPTIAOffsetCal ) |
Generated on Tue Jul 12 2022 21:32:08 by
1.7.2