RTC interrupts DS12C887

RTC DS12C887 has three interrupts namely, alarm interrupt, periodic interrupt and update interrupt.
ALARM INTERRUPTION
Alarm interruption occurs whenever the current time coincides with the alarm time. When this interrupt occurs, the corresponding flag in Register C is set. The IRQ pin also goes low only if the alarm interrupt enable bit is set in register B.
Alarm interruption can be programmed to occur at three different rates, namely, (a) once per day, (b) once per hour, (c) once per minute, and (d) once per second.
(A) Alarm once a day:
To program the alarm once a day, we write the desired time for the alarm in the hour alarm, minute alarm and second alarm registers (1,3 and 5 respectively). As the clock tells the time, when all three hour, minute, and second bytes of the RTC match the hour, minute, and second values ​​of the alarm, the AF (alarm flag) bit in the C register will go high. To use the RTC IRQ pin for an alarm, the alarm interrupt enable bit in register B (AIE) must be set high.
(B) Alarm once per hour:
To schedule the alarm interruption to occur once an hour, we write the value 11xxxxx at the alarm time. The value 11xxxxx means any hexadecimal value between C0H and FFH. Often FFH is used.
(W) Alarm once per minute:
To program the alarm once an hour, we write the value 11xxxxx in the alarm hour and minute records.
(D) Once per second alarm:
To schedule alarm once per second, we write FFH value in all three alarm registers i.e. alarm time, alarm minute and alarm second.
PERIODIC INTERRUPTION
The second interruption is the periodic interruption. Whenever a periodic interrupt occurs, the periodic interrupt flag (PF) will go high, at a rate defined by bits RS3-RS0 of register A. This rate can be from once every 500 ms to once every 122 microseconds . To use the IRQ pin of the RTC, the periodic interrupt enable bit in register B (PIE) must be set high. The following table describes the configuration of bits RS3-RS0 of Register A for the different time periods of the periodic interrupt.
RS3
RS2
RS1
RS0
Periodic Interruption Rate
0
0
0
0
None
0
0
0
1
3.9062ms
0
0
1
0
7.812ms
0
0
1
1
122,070 microseconds
0
1
0
0
244,141 microseconds
0
1
0
1
488,281 microseconds
0
1
1
0
976.5625 microseconds
0
1
1
1
1.953125ms
1
0
0
0
3.90625ms
1
0
0
1
7.8125ms
1
0
1
0
15.625ms
1
0
1
1
31.25ms
1
1
0
0
62.5ms
1
1
0
1
125ms
1
1
1
0
250ms
1
1
1
1
500ms
UPDATE FINISHED INTERRUPTION
This interrupt is used to indicate that the RTC time, date, and calendar values ​​have been updated and are ready to be served. The update cycle occurs once every second. Whenever this interrupt occurs, the corresponding bit in register C goes high.

Back to the blog

Leave a comment

Comments need to be approved before publication.