DA14531 Temperature sensor driver in SDK
ID: LPCBARESDK-672
Status: Fixed
First reported: 6.0.14.1114
Fixed in: 6.0.20.1338
Description
According to the DA14531 datasheet, the SW must restore the registers GP_ADC_OFFP_REG
and GP_ADC_OFFN_REG
to the default settings: 0x200. This is the value corresponding to the reference temperature.
In the SDK6, while reading the temperature, and if the sw is using the adc_offset_calibrate()
in order to calibrate the ADC, the registers GP_ADC_OFFP_REG
and GP_ADC_OFFN_REG
will have different values.
The mechanism to get correct temperature readings is following:
Store the calibration values from the registers into RAM
Set the default values (0x200) to these two registers
Perform a temperature measurement
Restore the calibration values from RAM into the registers
Workaround
As a workaround, the application should take care of storing the ADC registers configuration
in local variables before calling the adc_offset_calibrate()
function and restore the original value
once the ADC measurement is done.