RTCDue icon indicating copy to clipboard operation
RTCDue copied to clipboard

[Question] RTC Deep-sleep interrupt

Open kenanarica opened this issue 7 years ago • 4 comments

Newbie to CPU programming here. I'm trying to use the SAM3X's low-power backup mode to reduce energy consumption on my Due. One of the ways that the CPU can be woken is with an interrupt signal from the RTC, which is not turned off in backup mode. Ideally, I'm trying to do this routinely(Every X seconds) and I'd like to know if that is possible using this repo. Atmel has sample code for this but it's inaccessible because I'm on macOS. Thank you!

kenanarica avatar Jun 23 '17 17:06 kenanarica

Hi kenanarica can you give me a link to the sample code so I can have a look?

MarkusLange avatar Jun 24 '17 20:06 MarkusLange

Hi Markus, sorry for the late reply. The example code I've attached is from Atmel's example code for the RTC library, which I could only get my hands on using ASF. I'm looking to put my SAM3X into backup mode and wake it up using the interrupt feature the on-board RTC. However, I could not find the interrupt capability for RTCDue. Is there a way I could wake from backup mode using RTCDue?

(https://github.com/MarkusLange/RTCDue/files/1109858/rtc_example.c.zip)

On Sat, Jun 24, 2017 at 3:39 PM, MarkusLange [email protected] wrote:

Hi kenanarica can you give me a link to the sample code so I can have a look?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarkusLange/RTCDue/issues/2#issuecomment-310864539, or mute the thread https://github.com/notifications/unsubscribe-auth/AWMQLchjc6KpdkkMdIzTGqUT6encAZneks5sHXQfgaJpZM4OD3kC .

kenanarica avatar Jun 28 '17 15:06 kenanarica

Events are only possible for "1" Second or Minute or Hour, at Midnight or Noon, or on Week Month and Year changes not every X Seconds. Datasheed from SAM3X Page 247 and 253

Sorry, for the huge timedelay

MarkusLange avatar Jul 16 '18 11:07 MarkusLange

Actually the SAM3X IS capable of RTC alarm at any programmable date/time with interrupt and wake on alarm. Looking at the data sheet there is mention of this in section 5.6.1 (page 25) and the registers SUPC_WUMR (RTCEN) and PMC_FSMR (RTCAL) and the date time for the alarm in RTC_TIMALR and RTC_DATALR in the RTC control registers.

cc-michaelu avatar Jan 30 '22 16:01 cc-michaelu