This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Incorrect ADC readings after waking up from System Off Mode

Hello Nordic Team,

We are working on a project based on nrf51822, we have a problem regarding the incorrect ADC values while waking up the microcontroller from System Off Sleep mode.

Please find the ADC configuration we are using below

ret_code_t err_code = nrf_drv_adc_init(NULL, adc_event_handler);
APP_ERROR_CHECK(err_code);
static nrf_drv_adc_channel_t channel = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_6);
channel.config.config.input = (uint32_t)NRF_ADC_CONFIG_SCALING_INPUT_ONE_THIRD;
nrf_drv_adc_channel_enable(&channel);
err_code = nrf_drv_adc_buffer_convert(&adc_buf[0], 1);
APP_ERROR_CHECK(err_code);

We are getting proper values from ADC(let's say 610) after programming the nrf51 device. The incorrect readings start when the device goes to system off sleep mode and turned on again using a gpio pin. then the value from the ADC reads 30 less than the actual value (i.e 580).

I have to hard reset the device again to read the correct ADC value. Why is the reason for these incorrect readings?

Am I doing anything wrong? Please help us to resolve this issue at the earliest.

Best,

Krishna

Parents
  • What debugging have you done here? E.g. can it be any ripple or noise on the analog input, is there any decoupling (e.g. 1nF) on the analog input, if you read the input two times or more, is the result the same? If you add a delay after wakeup on system off, does it read the same then? 

    I am thinking that after a power on reset the startup time will be longer compared to wakeup from system off.

    Kenneth

Reply
  • What debugging have you done here? E.g. can it be any ripple or noise on the analog input, is there any decoupling (e.g. 1nF) on the analog input, if you read the input two times or more, is the result the same? If you add a delay after wakeup on system off, does it read the same then? 

    I am thinking that after a power on reset the startup time will be longer compared to wakeup from system off.

    Kenneth

Children
Related