8 REAL-TIME CLOCK (RTC)
8-14
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
Setting this bit to 0 starts the divider; setting it to 1 stops the divider.
The value read from this bit is 0 when the divider/counters are operating, and 1 when the counters are
idle.
This bit starts/stops the divider at the 32-kHz input clock divide-by stage of 8,192 Hz or stages that fol-
low. The counters do not stop at up to the input clock divide-by-2 stage (16,384 Hz).
If the divider stops while carry of a counter is taking place, the count value may be corrupted. There-
fore, see Section 8.3.5 to ensure that carry is not taking place when the divider is stopped. This is not
required when, for example, the contents of all counters are newly set again.
D0
RTCRST: Software Reset Bit
This bit resets the divider and output signals.
1 (R/W): Reset
0 (R/W): Negate reset (software reset value)
To perform software reset, write 1 to RTCRST and then write 0.
The software reset clears the 32 kHz to 2 Hz divider bits, negates the interrupt request and WAKEUP
signals, and initializes some control bits.
When setting up the RTC, first perform software reset using RTCRST.
RTC Control 1 Register (RTC_CNTL1)
Register name Address
Bit
Name
Function
Setting
Init. R/W
Remarks
RTC Control 1
Register
(RTC_CNTL1)
0x300a03
(8 bits)
D7–3 –
reserved
–
–
–
0 when being read.
D2
RTCRDHLD Read buffer enable
1 Enable
0 Disable
X (0) R/W
D1
RTCBSY
Counter busy flag
1 Busy
0 R/W possible X (0)
R
D0
RTCHLD
Counter hold control
1 Hold
0 Running
X (0) R/W
Init.: ( ) indicates the value set after a software reset (RTCRST
→
1
→
0) is performed.
D[7:3]
Reserved
D2
RTCRDHLD: Read Buffer Enable Bit
This bit enables or disables the read buffer.
1 (R/W): Enabled
0 (R/W): Disabled (software reset value)
In order to prevent carry over during reading counters, the RTC includes a read buffer to hold counter
data. Before reading counter data, set RTCRDHLD to 1 to load the current counter data to the read buf-
fer. While RTCRDHLD is set to 1, the buffered data is read out from the counter registers. Be sure to
reset RTCRDHLD to 0 after the buffered data is read out. This operation does not affect the counters.
The counters keeps counting while RTCRDHLD is set to 1.
D1
RTCBSY: Counter Busy Flag Bit
This flag indicates whether 1 is being carried over to the next-digit counter.
1 (R):
Busy (while carry is taking place)
0 (R):
Accessible for read/write (software reset value)
Attempting a write or stop operation may corrupt the counter values if 1 is being carried over. There-
fore, this bit should be checked to confirm that the counters are not in a carry (busy) state before writing
data to the counter registers.
When a value of 0 is read from RTCBSY after writing 1 to RTCHLD, it means that carry is not taking
place. In this state, counter data can be written to.
After 1 is written to RTCHLD, the counters stop operating. So RTCBSY is fixed at 0, as carry will not
take place. In this case, the counter hold function is also actuated, with a carry over of 1 to the 1-second
counter disabled in hardware. The divider (counter for less than one second) continues operating.
Write data to the counter registers. After writing data, reset RTCHLD to 0.
If 1 is being carried over when data is being written to a counter in the hold state, 1 second is automati-
cally added to correct the counter values when RTCHLD is reset to 0. This correction is only effective
for 1 second and no correction is conducted on the carry encountered in the second time and on. In this
case, the timekeeping data gets out of order. Therefore, be sure to reset RTCHLD to 0 as soon as pos-
sible after completing the required write operation.