Hi,
I want to calibrate SAADC for temperature compensation please guide me with example.
Hi,
I want to calibrate SAADC for temperature compensation please guide me with example.
I have used the following example and the issue is that after calibration done the first sample of saadc read is in -ive value or some thing 1,2,3,5,6 etc which is for more away from the actual value 1622-1630.
https://github.com/NordicPlayground/nRF52-ADC-examples/blob/master/saadc_low_power/main.c
Can it be related to this?
https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_86.html#anomaly_832_86
I think the example I linked already handle this as described.
Thanks Kenneth,
Please refer to some example code of doing this remedy.
Thanks Kenneth,
Please refer to some example code of doing this remedy.
The first link I shared contain an example that does this. Check out directly link (answer to question 5):
https://devzone.nordicsemi.com/f/nordic-q-a/39454/calibrating-saadc-on-nrf52832/152901#152901
Kenneth
Dear Kenneth,
I have followed this
https://devzone.nordicsemi.com/f/nordic-q-a/34785/saadc---calibration
and my code snipped is
if(saadc_calibrate == true)
{
while(nrf_drv_saadc_calibrate_offset() != NRF_SUCCESS); //Trigger calibration task
nrf_saadc_disable();
while(NRF_SAADC->STATUS == (SAADC_STATUS_STATUS_Busy << SAADC_STATUS_STATUS_Pos));
nrf_saadc_enable();
while(NRF_SAADC->STATUS == (SAADC_STATUS_STATUS_Busy << SAADC_STATUS_STATUS_Pos));
SEGGER_RTT_printf(0, "Calibration Done\n\r");
saadc_calibrate = false;
}
But still the first wrong sample issue persists.
I have also followed the following example
https://devzone.nordicsemi.com/f/nordic-q-a/32982/can-t-stop-saadc/127645#127645
it causes all the 5 samples to be corrupted after calibration.
I have tried this link and found the issue of my problem.
https://devzone.nordicsemi.com/f/nordic-q-a/48462/questions-on-saadc-calibration-gain-best-use