[riot-devel] Long time sleeping of the microcontroller

Daniel Krebs mail at daniel-krebs.net
Sat Jun 4 14:38:07 CEST 2016

Hi Bernhard,

> As far as I understand the function of the xtimer is designed to provide
> the
> timebase for thread/task switching and providing short low-power-delays.
> It is therefore not designed to support slow clock timers inside
> low-power microcontrollers.

That's partly true. There is a series of PRs [1 et al.] that aim to
implement a slow/low power timer source for xtimer. I wanted to use them
myself but unfortunately this work isn't finished yet.

> Can you give tell me your opinion about using the slow-clock timer
> simply inside
> the application? The idea is to bring the peripherals to lowest power
> mode, then
> stop all threads except the main thread, mask interrupts und stop then the
> microcontroller under the control of the application. The wakeup could
> happen
> by using an interrupt from the slow-clock-timer inside the CPU.

I've used the realtime clock to wakeup the MCU after a sleep interval. I
was using the famous samr21-xpro board and implemented the realtime
timer (RTT) interface for it. With the peripherals configured correctly
I could get my MCU down to several microamps too.

For the same board there is another long-standing PR [2] to implement
low power states. I'm not sure about the current state of LPM in RIOT
(didn't follow this for some time), but back then you needed to
manipulate `lpm_prevent_sleeping` to put everything to sleep. But this
will likely impact networking.


[1] https://github.com/RIOT-OS/RIOT/pull/3990
[2] https://github.com/RIOT-OS/RIOT/pull/2309

Am 04.06.2016 um 14:15 schrieb Bernhard Nägele:
> Hello RIOT-enthusiasts,
> I'm searching for a good way to bring a RIOT-system to lowest power
> modes for several minutes.

> Is this a way which could work?
> Best regards,
> Bernhard
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

More information about the devel mailing list