RX − 8564 LC
Page − 29
ETM12E-01
13.5. Flow Charts
• The flow charts shown below are intended as examples only.
∗ These examples are written to be easily understood, and therefore they may not be as efficient as the actual
processing.
∗ Ways to boost processing efficiency include setting several processes as parallel processes and changing the
sequence of operations in areas where it does not create any problems. (Some of the processing described here
may not be necessary under certain use conditions.)
∗ To ensure that operations are as expected, make adjustments according to the use conditions (use environment).
1) Initialization example
Go to next process
Initialization
Initialize Control
1
register
•
Initialize the Control 1 register. (Reg-00[h])
•
Be sure to write "0" to the two TEST bits.
Initialize Control 2
register
•
Initialize the Control 2 register. (Reg-01[h])
• Write "0" to the AIE and TIE bits to prevent output of unintended interrupts.
Set current time
•
Set "[Year/Month/Day [day of week] hour:minute:second]. (Reg-02[h] to
08[h])
∗
For current time setting, refer to "Write to clock and calendar" below.
Set alarm interrupt
•
Set the alarm interrupt function. (Reg-09[h] to 0C[h])
(If the alarm interrupt function is not being used, we recommend writing "1"
to all four AE bits.)
Set CLKOUT output
•
Set the CLKOUT output pin's output status. (Reg-0D[h])
(Since the initial power-on setting is "output 32.768 kHz clock", write "0" to
the FE bit to stop output.)
Set timer interrupt
•
Set the timer interrupt function. (Reg-0E[h] to 0F[h])
(If the timer interrupt function is not used, write "0" to the TE bit.)
∗ The address auto increment function can be used to set continuous writing
from Reg -
00[h]
to 0F[h] during initialization.
In such cases, be sure to write "1" to the STOP bit (to stop the clock) before
starting the continuous write operation, and write "0" to the STOP bit (to
start the clock) once initialization is completed.
2) Example of initial power-on processing
To next process
Initial power-on
processing
Wait
•
Wait until the internal crystal oscillator has begun to oscillate.
(This wait time should be about one second. For details, refer to the
regulation for the oscillation start time t
STA
[s].)
Initialization
•
Be sure to initialize all registers.
(For further description of initialization, see "Initialization" below.)