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

Yet another ADC question

Hello, My device is based on nRF51822 SD110 v8.0. Softdevice is enabled, but no BT functionality used. I measure 2 different voltages with ADC each second with two channels. It works, but after each 4096 seconds it measure incorrect (lowered) values for next 4096 seconds. And latches back to correct measurement...
Single channel voltage measurement in time scale (Grid divide by 4096s). Device is powered from line adaptor and supply voltage is constant. The only thing I found that could be participal is NRF_RTC1 timer that I use to count seconds.

 NRF_RTC1->CC[1] =     4096;
 NRF_RTC1->PRESCALER   = (8-1);

and take to count seconds - NRF_RTC1->COUNTER/4096

Any idea?

Parents
  • Ok, then that is not the case.

    Could you try to not put the device to sleep (not call sd_app_evt_wait()) and see if the result is the same. You can also try to keep the HFCLK on all the time with:

    uint32_t p_is_running = 0;
    sd_clock_hfclk_request();
    while(! p_is_running) {                             //wait for the hfclk to be available
        sd_clock_hfclk_is_running((&p_is_running));
    }
    

    And see if the result is still the same.

    Just wondering: You say that you use line adaptor, but the graph looks very much like the discharge curve of a battery (if you don't look at the erroneous measurements). You are sure that the graph is not when measuring battery?

Reply
  • Ok, then that is not the case.

    Could you try to not put the device to sleep (not call sd_app_evt_wait()) and see if the result is the same. You can also try to keep the HFCLK on all the time with:

    uint32_t p_is_running = 0;
    sd_clock_hfclk_request();
    while(! p_is_running) {                             //wait for the hfclk to be available
        sd_clock_hfclk_is_running((&p_is_running));
    }
    

    And see if the result is still the same.

    Just wondering: You say that you use line adaptor, but the graph looks very much like the discharge curve of a battery (if you don't look at the erroneous measurements). You are sure that the graph is not when measuring battery?

Children
No Data
Related