![Seiko Epson S1C17153 Technical Manual Download Page 54](http://html1.mh-extra.com/html/seiko-epson/s1c17153/s1c17153_technical-manual_1235939054.webp)
8 Real-TiMe ClOCK (RTC)
S1C17153 TeChniCal Manual
Seiko epson Corporation
8-3
(Rev. 1.0)
RTC Control
8.3
Operating Clock Control
8.3.1
The RTC module uses the 256 Hz clock output by the CLG module (256 Hz clock derived from the OSC1A di-
vider) as the operation clock. Therefore, the OSC1A oscillator must be turned on before starting the RTC. However,
the clock is not supplied to the RTC module while RTC is stopped even if the OSC1A oscillator is on. For detailed
information on clock control, see the “Clock Generator (CLG)” chapter.
notes
: • The RTC module input clock frequency is 256 Hz only when the OSC1A clock frequency is
32.768 kHz. The frequency described in this chapter will vary accordingly for other OSC1A
clock frequencies.
• The OSC1A divider is reset when the RTC starts running (when 1 is written to RTCRUN/RTC_
CTL register). This affects the count operations of the timer modules (CT, WDT, and T16A2),
as new 256 Hz clock cycle begins from that point.
•
After an initial reset, RTCRUN is set to 0 and the RTC idles. The OSC1A oscillator circuit is
also idle. Therefore, resetting the IC suspends the RTC operation for the period shown below.
RTC idle time = [#REST = low period] +
[OSC3B oscillation stabilization time] +
[Time until OSC1A is started] +
[OSC1A oscillation stabilization time] +
[Time until RTC is restarted]
12-hour/24-hour mode selection
8.3.2
Whether to use the clock in 12-hour or 24-hour mode can be selected using RTC24H/RTC_CTL register.
RTC24H = 1: 12-hour mode
RTC24H = 0: 24-hour mode
The count range of the hour counter changes with this selection.
Basically, this setting should be changed while the counters are idle. RTC24H is allocated to the same address as
the control bits that start the counters. Therefore, 12-hour mode or 24-hour mode can be selected at the same time
the counters are started.
Checking a.M./P.M. with 12-hour mode selected
When 12-hour mode is selected, AMPM/RTC_H register that indicates A.M. or P.M. is enabled.
AMPM = 0: A.M.
AMPM = 1: P.M.
For 24-hour mode, AMPM is fixed to 0.
When setting the time of day, write either of the values above to this bit to specify A.M. or P.M.
RTC Start/Stop
8.3.3
The RTC starts counting when RTCRUN/RTC_CTL register is set to 1, and stops counting when this bit is set to 0.
The OSC1A divider in the CLG module is reset by writing 1 to RTCRUN and it starts division of the OSC1A clock.
Counter Settings
8.3.4
Counter values should be set in the procedure shown below.
1. Stop the RTC by writing 0 to RTCRUN/RTC_CTL register.
2. Wait until RTCST/RTC_CTL register is reset to 0 (the RTC actually stops operating).
3. Write the counter values to the RTC_MS and RTC_H registers.
4. Start the RTC by writing 1 to RTCRUN/RTC_CTL register.