SLAZ753A October   2023  – May 2024 MSPM0C1103 , MSPM0C1103-Q1 , MSPM0C1104 , MSPM0C1104-Q1

 

  1.   1
  2.   Abstract
  3. 1Functional Advisories
  4. 2Preprogrammed Software Advisories
  5. 3Debug Only Advisories
  6. 4Fixed by Compiler Advisories
  7. 5Device Nomenclature
    1. 5.1 Device Symbolization and Revision Identification
  8. 6Advisory Descriptions
    1. 6.1 ADC_ERR_06
    2. 6.2 I2C_ERR_03
    3. 6.3 PMCU_ERR_07
  9. 7Revision History

ADC_ERR_06

ADC offset error needs to be calibrated in application code

Revisions Affected

Rev C

Details

The calibration data of ADC offset error is not applied correctly AND needs to be implemented in application code.

Workaround

The calibration data is stored at address 0x41C40040 in factory region. Two DriverLib APIs DL_ADC12_getADCOffsetCalibration AND DL_FactoryRegion_getADCOffset have been implemented in the SDK to facilitate this.

__STATIC_INLINE int16_t DL_ADC12_getADCOffsetCalibration(float userRef)

{

float adcBuff = DL_FactoryRegion_getADCOffset() * (3.3 / userRef);

return (int16_t)(round(adcBuff));

}

__STATIC_INLINE float DL_FactoryRegion_getADCOffset(void)

{

return ((float) (*(int16_t *) (0x41C40040)));

}

The calibration data can be saved into a variable AND subsequently applied to the ADC conversion result.

Below is the example code demonstrating how to apply the calibration data, which has been integrated into the ADC examples provided in the SDK:

volatile uint16_t gAdcResult;

volatile int16_t gADCOffset;

gADCOffset = DL_ADC12_getADCOffsetCalibration(ADC12_0_ADCMEM_0_REF_VOLTAGE_V);

gAdcResult = DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_0);

int16_t adcRaw = (int16_t) gAdcResult + gADCOffset;

if (adcRaw < 0) {

adcRaw = 0;

}

if (adcRaw > 4095) {

adcRaw = 4095;

}

gAdcResult = (uint16_t) adcRaw;

The ADC offset calibration data can be applied for the example use cases below:

  • Utilizing ADC without DMA - the offset needs to be added to ADC result from the register MEMRES.
  • Utilizing ADC with DMA - the offset needs to be added to ADC result stored in the memory address.
  • Utilizing ADC window comparator - the offset needs to be subtracted from window threshold used when configuring the comparator feature.