Skip to content

LP patches walkthrough

Michael Andersen edited this page Sep 27, 2016 · 2 revisions

This will walk through the empirical measurements done to evaluate the low power patches we (@immesys & @hyungsin) are submitting.

Hardware

Development was done using a stripped down Hamilton mote with no sensors, as we are trying to get this board out for people to use, and supported as a first-class platform on RIOT. The stripped down board looks like this:

The chip in question (SAMR21E18A) is very similar to the SAMR21G18A on the xpro board that RIOT supports, but it has a reduced pinout. For the most part this is inconsequential except that it does not have pins for an XOSC32, which does influence some of the code.

Because nobody has this board yet (my bad, I'm sorry, we're working on it) I will also show you how to rework a SAMR21 XPro board to remove all the cruft that gets in the way of measuring power. This is a destructive modification and you will need a JTAG programmer.

Application

For this test we use a slightly modified version of examples/timer_periodic_wakeup. For the hamilton hardware, the modifications are

diff --git a/examples/timer_periodic_wakeup/Makefile b/examples/timer_periodic_wakeup/Makefile
index e8744e1..1fa229d 100644
--- a/examples/timer_periodic_wakeup/Makefile
+++ b/examples/timer_periodic_wakeup/Makefile
@@ -1,6 +1,10 @@
 APPLICATION = timer_periodic_wakeup
 RIOTBASE ?= $(CURDIR)/../..
-BOARD ?= native
+BOARD ?= hamilton
+USEMODULE += at86rf233
+USEMODULE += gnrc_netdev_default
+USEMODULE += auto_init_gnrc_netif
+USEMODULE += rtt_stdio
 USEMODULE += xtimer
 QUIET ?= 1
 
diff --git a/examples/timer_periodic_wakeup/main.c b/examples/timer_periodic_wakeup/main.c
index 15e4f01..e8a5ae7 100644
--- a/examples/timer_periodic_wakeup/main.c
+++ b/examples/timer_periodic_wakeup/main.c
@@ -27,7 +27,7 @@
 
 int main(void)
 {
-    uint32_t last_wakeup = xtimer_now();
+    xtimer_ticks32_t last_wakeup = xtimer_now();
 
     while(1) {
         /* note: the below conversion of a constant INTERVAL from microseconds

Modifying the SAMR21 XPRO

Clone this wiki locally