Knowledge Base

This section describes the various hardware aspects of the RTC.

What is described is in reality the programming model, which may or may not correspond to the physical hardware. The programming model is what your SPLat program sees and has to handle. You should also look at the RTC documentation for the specific controller you are using.

The RTC consists internally of a number of registers for hours, minutes, seconds, year, month etc. There are also a number of registers associated with the events. Rather than make this large number of registers individually addressable, we have created a a number of shared registers that the RTC can be read into and written from. Thus, to set the time, you read the time from the RTC into the registers HH and MM, alter those registers and when done write them back to the RTC time. The very same HH and MM registers are used to set events. Hence, the same routine can easily be used to set the time of day and to set event times.

An event comprises a set of registers that store the hour and the minute when the event is to trigger, plus a 7-bit mask that contains one bit per day of the week. An event triggers when the event hours and minutes match the current time and the current day is represented by a bit set in the corresponding position in the day mask. An event can only be tested for true (triggered) during the exact minute it is set for, and can only be read out as true once per day.