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

RTC turns off when using idle_state_handler in ble_app_template

Hi

Im developing an application that will wake up on RTC every 15 minutes. My issue is that when using idle_state_handle, which in turn calls sd_ble_app_wait, the RTC will turn off, and therefore will not wake up from this source. This is verified using prints to a terminal. Ive tried using both app_timer and configuring RTC2 myself, both have the issue. 

My question is how can i configure the sd_ble_app_wait to first of all not turn off the RTCs  and second of all, how can i choose to wake up from RTC?

Im on windows, using SDK17 on a 52840 using a devkit PCA10056. 

Parents
  • configuring RTC2 myself, both have the issue. 

     Have you enabled the compare event's interrupt? If not, it won't wake up the CPU. 

     

    My question is how can i configure the sd_ble_app_wait to first of all not turn off the RTCs  and second of all, how can i choose to wake up from RTC?

    sd_app_evt_wait does not turn off the RTCs. 

  • I clearly see an output when using RTC2, so im pretty confident that the compare event works as intended. 

    I've isolated the problem to happen only when advertising stops. Does anything happen when advertising stops and no connections has been made? perhaps it enters system_OFF when advertising stops

  • ThomasN12 said:
    say I want to wake up on any event compared to wake up on RTC? Is this the same state, but dependent on which peripherals are actually running on the chip during sleep or are there actual registers that needs to be set during shutdown?

    If you enable any Peripheral Interrupt then that is a wake-up source from SystemON, Idle (sleep). Ie. turn on the interrupt of any of the RTC's COMPARE events and it will wake up the CPU, execute that interrupt handler and return to whatever execution state the CPU was in before it went to sleep. 

    See for instance the RTC's INTENSET register. 

    Usually, this register is configured by the RTC driver, depending on what config parameters it was given during set-up. See f.ex. nrfx_rtc_cc_set and its enable_irq parameter. 

  • Thank you for these answers, they are very helpful. i ahve managed to implement it succesfully.

    Another question that is springing to mind is numbers regarding the current consumption when running from a DCDC vs LDO in sleep mode. The numbers specified in the datasheet are only shown for an LDO, but im curious to know how using the internal DCDC converter will affect these numbers or if it has any effect at all. I can see nubmers are specified for when the CPU is running, but since it will spend most of its time in sleep, these numbers are of smaller significance. 

  • The current consumption for the active state is of less significance, since the board will only be active for small timeslots. But when its sleeping for such elongated periods the sleep current is now of larger importance. There are however only current consumptions listed for LDO usage and not DCDC for sleep. Will they be the same or will it be lower for DCDC compared to the LDO?

  • The LDO is more efficient at low current consumption. The DCDC is only used when the current consumption is high, like when the CPU or RADIO is running, otherwise, it is turned off. This is automatically handled and you don't need to do anything. 

    I suggest you measure the current consumption on the DK running your code with and without the DCDC and compare the results. 

Reply
  • The LDO is more efficient at low current consumption. The DCDC is only used when the current consumption is high, like when the CPU or RADIO is running, otherwise, it is turned off. This is automatically handled and you don't need to do anything. 

    I suggest you measure the current consumption on the DK running your code with and without the DCDC and compare the results. 

Children
No Data
Related