working of Real time clock

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

cross mob
Anonymous
Not applicable
        I saw the data sheet but there is no much information. How does RTC work. RTC start with current and time and date then we set alarm time and date then how does alarm happen. I saw there is mask and alarm handler mask is used to match current time date with alarm time and date and alarm handler is used to call the alarm function So please tell how does RTC work from beginning??   
0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

User sets current time into RTC.

   

 

   

The alarm mask allows user to set an alarm on any combination of hours,

   

mins, secs, year, date, month etc.. So if you want an alarm to fire just in

   

the year 2020 on a specific hour, mask allows you to do that. Or every day

   

at 20:13, masking again allows you to ignore all but the hours and minutes.

   

 

   

In other words masking permits you to set an alarm that ignores some RTC

   

date/time parts, and use only specifc parts of the total data/time readings.

   

 

   

Regards, Dana

View solution in original post

0 Likes
3 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

User sets current time into RTC.

   

 

   

The alarm mask allows user to set an alarm on any combination of hours,

   

mins, secs, year, date, month etc.. So if you want an alarm to fire just in

   

the year 2020 on a specific hour, mask allows you to do that. Or every day

   

at 20:13, masking again allows you to ignore all but the hours and minutes.

   

 

   

In other words masking permits you to set an alarm that ignores some RTC

   

date/time parts, and use only specifc parts of the total data/time readings.

   

 

   

Regards, Dana

0 Likes
Anonymous
Not applicable
        I looked RTC program there is some point Main function performs following functions: *   1. Declares date and time structure and fill it with the initial values *   2. Enables global interrupts *   3. Sets initial time and date values *   4. Sets alarm date, time and mask     /* Set alarm mask */     RTC_WriteAlarmMask(RTC_ALARM_SEC_MASK   | RTC_ALARM_MIN_MASK        |                        RTC_ALARM_HOUR_MASK  | RTC_ALARM_DAYOFMONTH_MASK |                        RTC_ALARM_MONTH_MASK | RTC_ALARM_YEAR_MASK); Should we fill mask with some value like alarm time date I saw in program I don't understand which line say Alarm is happening. How to know that Alarm is happening ?   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

There are a set of ISRs that fire if enabled by mask. You add code for

   

the ones that concern your alarm, and check by reading data/time and

   

checking against the ISR values that constitute your alarm settings.

   

 

   

t-text-stroke-width: 0px; ">      Every Second handler – RTC_EverySecondHandler()
 Every Minute handler – RTC_EveryMinuteHandler()
 Every Hour handler – RTC_EveryHourHandler()
 Every Day handler – RTC_EveryDayHandler()
 Every Week handler – RTC_EveryWeekHandler()
 Every Month handler – RTC_EveryMonthHandler()
 Every Year handler – RTC_EveryYearHandler()

   

 

   

Regards, Dana.