MSP430™CapTIvateSoftwareLibraryAPIGuide  1_83_00_05
Functions
CAPT_CALIBRATION

This module contains sensor calibration routines. More...

Functions

void CAPT_calibrateSensor (tSensor *pSensor)
 
void CAPT_calibrateSensorWithEMC (tSensor *pSensor)
 
void CAPT_calibrateGain (tSensor *pSensor, volatile bool *pbEndOfConversionFlag, uint8_t ui8Frequency)
 
void CAPT_calibrateBiasCurrentTrim (tSensor *pSensor, volatile bool *pbEndOfConversionFlag, uint8_t ui8Frequency)
 Only valid on certain devices, please consult device-specific datasheet. More...
 
void CAPT_calibrateOffset (tSensor *pSensor, volatile bool *pbEndOfConversionFlag, uint8_t ui8Frequency)
 

Detailed Description

This module contains sensor calibration routines.

Version
VERSION Released on RELEASE_DATE

Function Documentation

§ CAPT_calibrateSensor()

void CAPT_calibrateSensor ( tSensor pSensor)

The calibrate sensor function calibrates all elements in the sensor based on the sensor's input conversion gain and conversion count parameters.

This routine calibrates at one frequency only, and is intented to be used in applications where noise immunity (EMC) features are disabled.

After this function has completed running, the following outputs are set:

  • The coarse gain, fine gain, and offset tap for each element are saved in the element structure's pTuning array for frequency 0 only.
  • The bCalibrationError parameter in the sensor structure is set if a valid calibration could not be obtained. If this bit is set, it means that the external capacitor being measured could not be scaled to meet the desired conversion gain and conversion count inputs that were requested.
Parameters
pSensoris a pointer to the sensor to adjust
Returns
none

§ CAPT_calibrateSensorWithEMC()

void CAPT_calibrateSensorWithEMC ( tSensor pSensor)

The calibrate sensor function runs all of the necessary calibration routines to achieve the desired sensitivity for a sensor with EMC (noise immunity) enabled. This involves calibrating gain and offset at 4 conversion frequencies based on the sensor's input conversion gain and conversion count parameters, and ensuring that all calibration values are valid.

After this function has completed running, the following outputs are set:

  • The coarse gain, fine gain, and offset tap for each element are saved in the element structure's pTuning array for frequency 0-3 (4 total)
  • The bCalibrationError parameter in the sensor structure is set if a valid calibration could not be obtained. If this bit is set, it means that the external capacitor being measured could not be scaled to meet the desired conversion gain and conversion count inputs that were requested. This bit is also set if noise was detected on all 4 conversion frequencies, in which case calibration is not possible.
  • The bSensorNoiseState parameter in the sensor structure is set if noise was present for at one or more conversion frequencies.
Parameters
pSensoris a pointer to the sensor to adjust
Returns
none

§ CAPT_calibrateGain()

void CAPT_calibrateGain ( tSensor pSensor,
volatile bool *  pbEndOfConversionFlag,
uint8_t  ui8Frequency 
)

The calibrate gain parameter function identifies the correct gain ratio to achieve the specified conversion gain. Note that this calibration will clear out any offset applied by a call to CAPT_calibrateOffset(). Call this calibration function first.

Parameters
pSensoris a pointer to the sensor to calibrate
Returns
none

§ CAPT_calibrateBiasCurrentTrim()

void CAPT_calibrateBiasCurrentTrim ( tSensor pSensor,
volatile bool *  pbEndOfConversionFlag,
uint8_t  ui8Frequency 
)

Only valid on certain devices, please consult device-specific datasheet.

The calibrate bias current trim parameter function identifies the correct bias current trim to achieve the specified conversion gain. Note that this calibration should be called after CAPT_calibrateGain() but before CAPT_calibrateOffset().

Parameters
pSensoris a pointer to the sensor to calibrate
Returns
none

§ CAPT_calibrateOffset()

void CAPT_calibrateOffset ( tSensor pSensor,
volatile bool *  pbEndOfConversionFlag,
uint8_t  ui8Frequency 
)

The calibrate offset parameter function identifies the correct offset tap to achieve the specified conversion count.

Parameters
pSensoris a pointer to the sensor to calibrate
Returns
none
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale