You are here

how assign RTC to trigger alarm ? | Cypress Semiconductor

how assign RTC to trigger alarm ?

Summary: 5 Replies, Latest post by chaplin.u_1533771 on 04 Nov 2016 03:16 AM PDT
Verified Answers: 2
Last post
Log in to post new comments.
chaplin.u_1533771's picture
User
104 posts

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 !

 

user_242978793's picture
User
1029 posts

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.

chaplin.u_1533771's picture
User
104 posts

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 ?

 

 

user_242978793's picture
User
1029 posts

Just change the alarm time to that time!!

user_242978793's picture
User
1029 posts

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

chaplin.u_1533771's picture
User
104 posts

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 ?

 

 

Log in to post new comments.