how assign RTC to trigger alarm ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

In datasheet of RTC I read this :

   

The component also has an optional alarm feature, which provides match detection for a second, minute, hour, day of week, day of month, month, and year. A mask selects what combination of time and date information will be used to generate the alarm. The alarm flexibility supports periodic alarms such as every twenty-third minute after the hour, or a single alarm such as 4:52 a.m. on September 28, 2043.

   

So my question is how assign RTC to trigger alarm  for example every Sunday  at 8.35 ?

   

Any example of code please !

0 Likes
5 Replies
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Remember that this is a software component so you can't use sleep. Here is an example program. I am running PSoC Creator 4.0.

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I have this example but in this code not exist ANY of string about how to set RTC to interrupt every Sunday  at 8.35 for example.

   

Can you change it to implement this possibility ?

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Just change the alarm time to that time!!

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is the place to change as you want Sunday set that also.

   

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Sorry I`m confused. For run RTC I need :

   

1. RTC_SetDateAndTime ...

   

2.  RTC_SetAlarmMask((uint32) RTC_ALARM_HOUR_MASK | RTC_ALARM_MIN_MASK | RTC_ALARM_DAYOFWEEK_MASK);

   

3.  RTC_SetAlarmHandler(AlarmerIsrHandler);

   

4. RTC_SetAlarmDateAndTime with first alarm Date and Time event.

   

And it`s enough to RTC work continuously for all next weeks ?

   

Or I need recalculate next alarm Date and set after trigger interrupt ?

0 Likes