Go Down

Topic: DUE lower power delay() with wfi (Read 480 times) previous topic - next topic

mantoui

I noticed on pyboard (ARM based) that my blink test didn't consume as much power as expected. It was because the firmware delay() used wfi, so processor sleeps waiting for interrupt. hence, low power.

The DUE delay() has weak reference to yield(), so I created a yield() function with asm("wfi") in my blink (5 second) sketch, and sure enough power was reduced.  LED off/on was 113.3/114.6 ma, but with wfi  was 87.4/88.9 ma

Perhaps, it might break other things. I didn't do any other testing, and perhaps this has been considered already, or maybe it's worth further investigation -- including the wfi in the core delay() for DUE.

(comments in teensy forums suggest similar sleep mode in delay() on AVR messed up subsequent ADC readings)

Go Up