8 Real-TiMe ClOCK (RTC)
8-4
Seiko epson Corporation
S1C17153 TeChniCal Manual
(Rev. 1.0)
RTCRUN
←
0
Register write
RTCRUN
←
1
RTCST = 0?
No
Yes
Counter setting
END
3.4.1 Procedure for Setting Counters
Figure 8.
notes
: • Do not set the counters while the RTC is running, as proper settings to the counters cannot be
guaranteed.
• Counter values to be set must be within the effective range according to binary/BCD mode.
The counter will be undefined if a value out of the range is written.
• Depending on the value set, an interrupt may occur immediately after starting the RTC.
Counter Read
8.3.5
If 1 is being carried over while the counters are being read, correct time may not be read.
Counter values should be read in the procedure shown below.
Read procedure 1
1. Read the RTC_MS and RTC_H registers.
2. Read the RTC_MS and RTC_H registers again.
3. If the same value is read out in Steps 1 and 2, use it as the correct time.
If different values are read out, try again from Step 1.
Read the RTC_MS and
RTC_H registers (A)
Read the RTC_MS and
RTC_H registers (B)
Current time = A (B)
A = B?
No
Yes
Counter read
END
3.5.1 Procedure for Reading Counters
Figure 8.
Read procedure 2
After a 1 Hz interrupt (or 10-second to 1 day interrupt) occurs, read the RTC_MS and RTC_H registers within
one second.