14 REAL-TIME CLOCK (RTC)
14-4
Seiko epson Corporation
S1C17F13 TeChniCal Manual
(Rev. 1.0)
Time Read
14.4.2
Read procedure 1
1. Read the RTCMIN and RTCHUR registers.
2. Read again.
i. If the two read values are the same, assume that the count values are read correctly.
ii. If different values are read, perform reading once more and compare the read value with the previous one.
Read procedure 2
1. Wait for a 1 Hz interrupt (or 10 seconds to one day interrupt) to occur.
2. Read the RTCMIN and RTCHUR registers within one second from Step 1.
Current time = A (B)
Read the RTCMIN and RTCHUR
registers (A)
Read the RTCMIN and RTCHUR
registers (B)
No
Yes
Counter read
END
A = B?
Read procedure 1
Current time = A
Read the RTCMIN and RTCHUR
registers (A)
No
Yes
Counter read
END
1 Hz interrupt?
Read procedure 2
within 1 second
4.2.1 Counter Read Procedure
Figure 14.
Interrupts
14.5
RTC has a function to generate the interrupts shown in Table 14.5.1.
5.1 RTC Interrupt Function
Table 14.
Interrupt
Interrupt flag
Set condition
Clear condition
One day
RTCINTF.1DIF
Hour counter = 23
→
0 (24H mode)
Hour counter = PM11
→
AM12 (12H mode)
Writing 1
Half-day
RTCINTF.HDIF
Hour counter = 11
→
12, 23
→
0 (24H mode)
Hour counter = AM11
→
PM12, PM11
→
AM12 (12H mode)
Writing 1
1 hour
RTCINTF.1HIF
Minute counter = 59
→
0
Writing 1
10 minutes
RTCINTF.10MIF Minute counter = 9
→
10, 19
→
20, 29
→
30, 39
→
40, 49
→
50, 59
→
0
Writing 1
1 minute
RTCINTF.1MIF
Second counter = 59
→
0
Writing 1
10 seconds RTCINTF.10SIF Second counter = 9
→
10, 19
→
20, 29
→
30, 39
→
40, 49
→
50, 59
→
0
Writing 1
1 Hz
RTCINTF.1HZIF Divider 1 Hz signal cycle
Writing 1
4 Hz
RTCINTF.4HZIF Divider 4 Hz signal cycle
Writing 1
8 Hz
RTCINTF.8HZIF Divider 8 Hz signal cycle
Writing 1
32 Hz
RTCINTF.32HZIF Divider 32 Hz signal cycle
Writing 1
The RTC provides interrupt enable bits corresponding to each interrupt flag. An interrupt request is sent to the in-
terrupt controller only when the interrupt flag, of which interrupt has been enabled by the interrupt enable bit, is
set. For more information on interrupt control, refer to the “Interrupt Controller” chapter.