Go Down

Topic: MKR Zero Board Sleep Mode (Read 190 times) previous topic - next topic


Oct 16, 2018, 03:08 am Last Edit: Oct 16, 2018, 03:22 am by androidfanboy

I'm trying to make my MKR Zero blink an LED, sleep for a couple seconds, then wake up by itself from internal RTC and repeat the action before going back to sleep. I'm testing the sleep feature with this Arduino LowPower Library example but when I upload it, it goes to sleep and never wakes up (it only blinks the LED once, then after that nothing happens). I can tell it's sleeping because I can no longer see the COM port, but the LED never flashes again.

I should note that this external interrupt wake up example works great, but the timed wakeup doesn't.

Any ideas what's going on here?



Ultimately my goal is to sleep it for, say, 5 minutes. I know this isn't possible with a single sleep cycle so I can just use a counter and count the number of sleep periods it has gone through. However, I would like to minimize the current consumption. Would the deepSleep() function work for the SAMD21 and draw less power than the sleep() function?

Also, I read that the max sleep time for a single cycle is 16s. Does that mean I can use deepSleep(16000) and it should wake up after 16s?


Well, I guess I solved my problem by using this RTCZero code. But that still doesn't explain why the LowPower library code doesn't work. It's based on the RTCZero library.


Oct 18, 2018, 09:16 pm Last Edit: Oct 18, 2018, 09:17 pm by androidfanboy
However, I measured the current consumption through a LiPo battery and uCurrent GOLD ammeter and it's drawing 1.0mA of current. I was expecting more like something in the uA range. Is this the lowest the M0 can go with only internal RTC enabled? That doesn't seem right.

Go Up