8 REAL-TIME CLOCK (RTC)
8-4
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
RTC Control
8.3
Operating Clock Control
8.3.1
Counter clock
The RTC is clocked by the 32.768-kHz (typ.) OSC1 clock. The OSC1 clock is always supplied from the OSC1
oscillator circuit (even in HALT/SLEEP mode).
Register clock
The PCLK2 clock is used for accessing the RTC control registers. To setup the registers, this clock is required.
After the registers are set up, the clock supply can be stopped by setting the CMU.
Setting the wait cycles for accessing the RTC module
In order to access the RTC registers properly even if the system operates with a high-speed clock, a wait cycle
can be inserted into the RTC access cycle. The number of MCLK cycles to be inserted as a wait cycle can be
specified using RTCWT[2:0]/MISC_RTCWT register.
3.1.1 Number of Wait Cycles during RTC Access
Table 8.
RTCWT[2:0]
Number of wait cycles
0x7
7 cycles
0x6
6 cycles
0x5
5 cycles
0x4
4 cycles
0x3
3 cycles
0x2
2 cycles
0x1
1 cycle
0x0
0 cycles (cannot be set)
(Default: 0x7)
The S1C33L26 is able to operate with RTCWT[2:0]
≥
1.
RTC Initial Sequence
8.3.2
Immediately after power-on, the contents of RTC registers are indeterminate. After powering on, follow the proce-
dure below to let the RTC start ticking the time. Later sections detail the contents of each control.
1. Power-on
2. System initialization processing and waiting for OSC1 stabilization
Although the OSC1 oscillator circuit starts oscillating immediately after power is switched on, a finite time of
up to 3 seconds is required before the output clock stabilizes.
3. Software reset
Write 1 to RTCRST/RTC_CNTL0 register and then write 0 to reset the RTC.
4. Confirming accessibility status of the RTC
See Section 8.3.5, “Counter Hold and Busy Flag.”
5. Disabling the divider
Write 1 to RTCSTP/RTC_CNTL0 register to stop the divider in the RTC module.
6. Setting the RTC interrupt
Set the RTC_INTMODE register.
Be sure to set RTCIMD to 1 (level sense).
7. Setting the date and time
Set the RTC_SEC, RTC_MIN, RTC_HOUR, RTC_DAY, RTC_MONTH, RTC_YEAR, and RTC_WEEK regis-
ters. Then, write 0 to RTCHLD/RTC_CNTL1 register to release the 1-second, 10-second, 1-minute, 10-minute,
1-hour, 10-hour, 1-day, 10-day, 1-month, 10-month, 1-year, 10-year, and days of week counters from hold sta-
tus.