I'm looking for a timer interrupt library for the new Arduinos based on MCU SAMD21.
I want to wake up periodically the MCU form sleep state, do some task and go sleep again. Using one timer interrupt Arduino wakes up. For new Arduino MKR family.
Do you know a library to do this?
-
I'm voting to close this question as off-topic because it is a request to find an external library or resource, which is not one of the intended purposes of the stack exchange network. Try a web search, it seems to yield results.Chris Stratton– Chris Stratton2017年12月31日 17:30:57 +00:00Commented Dec 31, 2017 at 17:30
-
3@ChrisStratton Library recommendations are on-topic, according to Arduino SE's on-topic help page.gre_gor– gre_gor2018年01月03日 20:21:13 +00:00Commented Jan 3, 2018 at 20:21
1 Answer 1
Do you know a library to do this?
it is generally very difficult to find a library that does precisely what your application wants. in fact, the purpose of a library is so that it is generic enough for you to tailor it for your specific application.
in this particular case, what you wanted to do is quite simple:
1) read through the datasheet;
2) figure out how the timer works;
3) figure out how the power management works;
4) configure timer isr to wake up the mcu periodically; an overflow isr is typically all you need;
5) run the task directly in the isr if is it short or set a flag for its execution in the loop;
6) upon completion, put the mcu to sleep.
all you need is to tackle the little steps above and you will get it done in no time, and learn a ton about your device.
device datasheet is the best friend of any embedded engineer, not the worst enemy.
-
3The question is if anyone knows a library, not how to do that, I know how to do. I'm looking for a similar library to mstimer2 (github.com/PaulStoffregen/MsTimer2) which has a generic purpose. I'm asking if anyone knows to avoid lost time doing it. The rest of the process is done in my project, you can find in github.com/jecrespo/Arduino-MKR-FOX-1200-Contest/blob/master/…jecrespo– jecrespo2017年12月01日 13:53:50 +00:00Commented Dec 1, 2017 at 13:53