Add examples making use of the RTC

Add an example using the RTC to help with a lower power design.  This is
a sister example to the existing "button-irq-printf", which is
functionally identical, but uses far less power.

There's more tricks that can be done to lower the power even further,
but this shows a few of the early steps that can be done, using the RTC
wakeup instead of a timer.
This commit is contained in:
Karl Palsson
2013-01-23 00:01:46 +00:00
parent e5b3250382
commit d9fb4f7401
11 changed files with 508 additions and 17 deletions

View File

@@ -0,0 +1,18 @@
This is _functionally_ identical to the "button-irq-printf"
example, but has been modified to use some low power features.
There is a 115200@8n1 console on PA2, which prints a tick count every second,
and when the user push button is pressed, the time it is held down for is
timed (in milliseconds)
Instead of free running timers and busy loops, this version uses the RTC
module and attempts to sleep as much as possible, including while the button
is pressed.
Status
~~~~~~
Only very basic power savings are done!
Current consumption, led off/on, 16Mhz HSI: 2.7mA/5.4mA
Current consumption, led off/on, 4Mhz HSI: 1.4mA/?.?mA
Current consumption, led off/on, 4Mhz MSI: 0.9mA/?.?mA