Operations; Time Setting - Epson S1C17F13 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

14.4

Operations

14.4.1

Time Setting

Follow the sequence shown below to set time to RTC.
1. Set the following RTCCTL register bits:
- Write 0 to the RTCCTL.RTCRUN bit. (Stop RTC)
- RTCCTL.BCDMD bit
- RTCCTL.RTC24H bit
2. Check to see if the RTCCTL.RTCST bit = 0 (RTC is idle). If the RTCCTL.RTCST bit = 1 (RTC is operating),
wait until it is set to 0.
3. Write a time to the control bits listed below.
- RTCMIN.RTCSEC[6:0] bit
- RTCMIN.RTCMIN[6:0] bit
- RTCHUR.RTCHUR[5:0] bit
- RTCHUR.AMPM bit
4. Write 1 to the interrupt flags in the RTCINTF register.
5. Write 1 to the interrupt enable bits in the RTCINTE register. (Enable interrupts)
6. Write 1 to the RTCCTL.RTCRUN bit.
Notes: • An initial reset does not initialize the second/minute/hour counter values. Be sure to initialize
the counters via software.
• Do not set the counters while the RTC is running (RTCCTL.RTCST bit = 1), 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.
• The divider that generates F256 (256 Hz regulated clock) is reset when the RTC starts run-
ning (when 1 is written to the RTCCTL.RTCRUN bit). This affects the count operations of
other timers that use F256, as new F256 cycle begins from that point.
• After an initial reset, the RTCCTL.RTCRUN bit is set to 0 and the RTC idles. The OSC1 oscil-
lator circuit is also idle. Therefore, resetting the IC suspends the RTC operation for the period
shown below.
RTC idle time = [#RESET = low period] + [Boot clock oscillation stabilization time] +
S1C17F13 TeChniCal Manual
(Rev. 1.0)
(Select binary/BCD mode)
(Select 24H/12H mode)
(Second)
(Minute)
(Hour)
(AM/PM) (effective when RTCCTL.RTC24H bit = 1)
(Start RTC)
Counter setting
Write 0 to the
RTCCTL.RTCRUN bit
RTCCTL.RTCST = 0?
Yes
Write data to the RTCMIN and
RTCHUR registers
Write 1 to the
RTCCTL.RTCRUN bit
END
Figure 14.
4.1.1 Counter Setting Procedure
[Time until OSC1 is started] + [OSC1 oscillation stabilization time] +
[Time until RTC is restarted]
Seiko epson Corporation
14 REAL-TIME CLOCK (RTC)
(Clear interrupt flags)
No
14-3

Advertisement

Table of Contents
loading

Table of Contents