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

saadc sample cant use with sd_power_system_off()

When I use saadc to sample battery's power,the software restart ceaselessly.I use the steps as following:

1.void saadc_init(void).

2.void saadc_callback(nrf_drv_saadc_evt_t const * p_event).read the sample value.

3.use nrf_drv_saadc_sample() in bsp_event_handler function. When button has pushed,saadc sample.

If I comment out saadc,software can go to sleep with sd_power_system_off().If do this ,device cant sample battery.

If I comment out sd_power_system_off(),software can work with saadc,but cant sleep.

So I don't know how to use saadc to sample and device can sleep not restart ceaselessly

Parents
  • FormerMember
    0 FormerMember

    sd_power_system_off() puts the chip in system OFF:   System OFF is the deepest power saving mode the system can enter. In this mode, the system’s core functionality is powered down and all ongoing tasks are terminated. 

    What you should use is the system ON mode: System ON is the default state after power-on reset. In System ON, all functional blocks such as the CPU or peripherals, can be in IDLE or RUN mode, depending on the configuration set by the software and the state of the application executing.

    To set the chip in system ON, use sd_app_evt_wait(). For how to use this function, see the BLE examples in the SDK.

  • Thank you for your reply.I see your point. I want to achieve  when chip works completely including sample battery's value and so on, it calls sd_power_system_off() enter system OFF to save power.

    While a button was pushed, the chip wake up , init saadc and use saadc to sample. 

    Now,the question is saadc module and system_off use together, the chip always restart from main. It seems somewhere mistake,but log cant print fatal error.

Reply
  • Thank you for your reply.I see your point. I want to achieve  when chip works completely including sample battery's value and so on, it calls sd_power_system_off() enter system OFF to save power.

    While a button was pushed, the chip wake up , init saadc and use saadc to sample. 

    Now,the question is saadc module and system_off use together, the chip always restart from main. It seems somewhere mistake,but log cant print fatal error.

Children
No Data
Related