RTCZero icon indicating copy to clipboard operation
RTCZero copied to clipboard

Feature: Periodic alarms between 1 sec and 1 minute

Open sslupsky opened this issue 7 years ago • 2 comments
trafficstars

The smallest period with the current version is 1 minute. It would be useful to be able to set periodic alarms that fire more frequently.

Perhaps something like MATCH_MS (match milliseconds) ? That would provide a 1 second period. I do not require anything fast than that.

It would be useful to be able to set the period to an arbitrary period between 1 and 59 seconds.

sslupsky avatar Sep 23 '18 17:09 sslupsky

I would like to submit a PR for this issue so I would like to get some feedback. I see two ways to accomplish a better than 1 minute periodic interrupt.

  1. Set a new ALARM timeout in the RTC hander.
  2. Use the Periodic Events

The first method is the technique I presently use. It has the disadvantage that it requires a write to the alarm register. This write causes a SYNCBUSY and requires about 6ms to complete. This is a concern when trying to save power.

The second method involves the Periodic Events generated from the RTC Prescaler. I think the SYNCBUSY delay can be avoided.

Are there any other ways to accomplish this? Any other feedback?

sslupsky avatar May 24 '19 18:05 sslupsky

If SYNCBUSY delay can be avoided, that would be great.

ravelab avatar Aug 14 '19 06:08 ravelab