RTC in Standby not running?

Started by Armando, April 18, 2019, 05:53:09 PM

Armando

Hi to all :)

In my project I used the sleep wake example for the Moteino MO guide page as a reference idea to wake up the MOTEINO M0 based on a certain time.

If I used the example it dose work fine.
If I set the alarm to wake up in 5 or 10min than it won't wake up.
It only works if I wake up every minute.
Further more I'm not able to read out the time from the RTC after a couple of sleep/ Wake cycels.

Could it be that the clock for the RTC in Standby mode is not configured correct?


When I tried to load the same code but used the Arduino Zero or MKR Boards instead of the Moteino MO, than it did work I could wake up every 5min and read out the time from the RTC but the power consumption went up to about 0,6mA, which is to high for my project.


Would there be any way to try a different RTC clock configuration for the Standby mode where I could wake up every 5min and read out the time as well? Whit a very low power consumption?

By the way, I love the Moteino M0 great board excellent engineered.

Thanks a lot
Armando

mantonakakis

I'm using a Moteino M0 for a LoRa node, and I was able to get it configured to have over-the-air adjustable send intervals with low-power sleep between each interval. So for example, I can make it sleep for 10 seconds, wake up, send data, then go back to sleep. I can send a command to the device to reset the interval for any time (I send it in seconds), and so far I have tested up to 10 minutes with no problem. Sleep current with the LoRa radio module and the FRAM module is about 7uA for me right now.

To make this work I am using the RTCZero library, but slightly differently than the example in the Moteino M0 guide.

In setup() I sleep the FRAM because I am not using it at the moment:
flash.initialize();
flash.sleep();

I also get the RTC started in setup() function:
zerortc.begin();
zerortc.setEpoch(0);

After my device finishes its operation, I do this:
zerortc.setAlarmEpoch(zerortc.getEpoch() + INTERVAL);
zerortc.enableAlarm(zerortc.MATCH_YYMMDDHHMMSS);
zerortc.attachInterrupt(alarmMatch);
zerortc.standbyMode();

My alarmMatch() function is empty right now and I set "INTERVAL" in seconds (e.g. 5min = 300s).
I haven't tried reading the RTC time (my LoRa data includes a timestamp from the gateway that receives it, so no need for me), so I'm not sure if that would work with this methodology - I imagine "getEpoch()" would give the time?