8 REAL-TIME CLOCK (RTC)
8-10
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
Software control
The WAKEUP output can also be controlled using WUP_CTL/RTC_WAKEUP register.
The WAKEUP signal is asserted by setting WUP_CTL to 1 and is negated by setting WUP_CTL to 0. WUP_
CTL is not initialized at initial reset, therefore, it must be set to 1 (active) at the beginning with the initialize
routine.
The table below shows the WAKEUP signal status according to the control bit.
5.1 WAKEUP Signal Status
Table 8.
Control bit settings
WAKEUP pin status
WUP_POL
WUP_CTL
RTCIRQ
1
1
1
0 (Low)
1
1
0
0 (Low)
1
0
1
0 (Low)
1
0
0
1 (High)
0
1
1
1 (High)
0
1
0
1 (High)
0
0
1
1 (High)
0
0
0
0 (Low)
When a software reset is performed (RTCRST
→
1
→
0), WUP_CTL and WUP_POL are reset to 0 to set the
WAKEUP signal to 0.
Control procedures
The following shows some power control procedures using the system standby/wakeup circuit shown in Figure
8.5.1. The description below assumes that the power (3.3 V) is supplied to the regulator and the WAKEUP sig-
nal polarity is set to active high.
Power On using the POWER SW
(1) Press the POWER SW. The switch must be held down until Step (5) has completed.
(2) The regulator is enabled to output voltage and the 1.8 V (and 3.3 V) voltage is supplied to the S1C33L26
LV
DD
, PLLV
DD
, HV
DD
, and AV
DD
pins.
(3) The CPU starts operating and executes the initialize routine after power-on reset.
(4) Configure GPIO (2) as an output port and set the port output level to 1 (high). This signal is fed to the
#STBY pin resulting that the RTCV
DD
system circuits will be connected to the system.
(5) Write 0x2 to the RTC_WAKEUP register to set the WAKEUP polarity to active high and enable the WAKE-
UP pin to output 1 (high). This control fixes the regulator output to be enabled, thus the POWER SW can
be released (turned off).
(6) Read the key from the specific BBRAM location and check whether the backup data is valid or not (e.g.
valid if 0xaa). Then if valid, read the backup data from the BBRAM.
(7) Clear the key located in the BBRAM (e.g. write a value such as 0x00).
(8) Execute other processing.
Keep the #STBY input = 1 and WAKEUP output = 1 conditions while the IC is operating.
Power Off using the POWER SW
The following procedure should be started under the above condition (#STBY input = 1 and WAKEUP output
= 1).
(1) Press the POWER SW.
(2) The GPIO (1) port inputs 1 (high). Detect this status by reading the input data or using an interrupt from the
port, and execute the sequence to place the S1C33L26 into battery backup mode.
(3) Copy the data required to be saved into the BBRAM. In addition to this, write a key for indicating that the
backup data is valid (e.g. 0xaa) to the specific location in the BBRAM.
(4) Set the RTC interrupt conditions and enable the interrupt. (when restarting the system using an RTC inter-
rupt)
(5) Write 0x0 to the RTC_WAKEUP register to set the WAKEUP pin to output 0 (low).
(6) Set the GPIO (2) port to output 0 (low). This signal is fed to the #STBY pin resulting that the RTCV
DD
sys-
tem circuits will be disconnected from the system.