RSL10 ultra low power delay

Hi everyone!

I’m using the “peripheral_server_sleep_ext” example and would like to wait 250ms upon startup. So before doing anything else, I would like to wait for 250ms with the least amount of energy consumption possible.

I already tried to call Sys_Delay_ProgramROM(250 * (SystemCoreClock / 1000)); right at the beginning of main() and _start (), but the waiting period consumes still to much energy.
According to the Hardware reference the Sys_clock at startup is the RC oscillator at 3Mhz, is that right?
It is possible to change it to 32kHz right at the beginning and to change it back after the 250ms, this should reduce the energy consumption.

Doesn’t the example sleep_RAM_retention basically does this? Go into sleep with a 32kHz timer and wake up after 1s? But I want to do it just once at the beginning.

Thank you for your help!

Best regards

I would like to state my question more precisely:
Is it possible to change the Sys clock to 32kHz right at the beginning and to change it back after the 250ms?
If it is possible, how should it be done in the "peripheral_server_sleep_ext” example?

Or is there a better solution to meet my requirements?

Thank you for your help!
Regards

@stzi

I’m using the “peripheral_server_sleep_ext” example and would like to wait 250ms upon startup. So before doing anything else, I would like to wait for 250ms with the least amount of energy consumption possible.

You need to replace 3 seconds to 250mss when power on. Check RTC alarm time to have 1s sleep interval . The sleep clock is 32KHz. (assuming that you use XTAL32K).
As on the picture below, you need adjust sys_delay_programROM() to have 250ms and then adjust RTC_alarm interval time to 1s. This should meet your requirement.
1 second RTC alarm

/* Select RTC alarm time interval (in second)*/
#define RTC_ALARM_INTV_S                1.0

250ms POR .

   else
    {
        /* Power-on reset */

        /* Wait for 3 seconds to allow re-flashing after reset */
        Sys_Delay_ProgramROM(0.250 * SystemCoreClock);


Test result:

According to the Hardware reference the Sys_clock at startup is the RC oscillator at 3Mhz, is that right?
It is possible to change it to 32kHz right at the beginning and to change it back after the 250ms, this should reduce the energy consumption.

We can’t change RC startup clock to 32KHz. We need fast clock to run system initialization and enter main() function.

The sleep clock is 32KHz.

According to the Hardware reference the Sys_clock at startup is the RC oscillator at 3Mhz, is that right?

The default RCOSC frequency is 3MHz. We have verified this with analyzer below.

image

SYSCLK = RCCLK

Thank you for using our community forum!

Hi @martin.bela

Thank you for your response and your explanations!
I took some time to test some things.
As I explained in my first post, Sys_Delay_ProgramROM(0.250 * SystemCoreClock); consumes still to much energy. So this did not solved it.

But the picture of your measurement helped me. As you can see, during the delay period, you still have a current around 300-600uA. But during the deep sleep phase, you have a couple nA.
So I initilized a deep sleep phase right at the beginning. Before doing anything else.
And it works just as expected.

Thank you.

1 Like