Chapter 12
Real Time Clock (RTC)
RTC Operation XII - 17
12.3.2 Setup Example
Periodic Interrupt Setup Example
The following is an example to generate a periodic interrupt with a cycle of a minute with the RTC function. Set
the initial time to "01:01:00 (Thursday), April 01, 2010" in 24-hour display mode.
The setup procedure and the description of each step are shown below.
Step Setting Symbol Description
1 RTC stops RTCCTR Set the CLKEN bit to "0".
2 Periodic interrupt disabled RTCCIRQ Set the CIRQMIEN bit to "0".
3 Display mode setting RTCCTR Set the HDMD bit to "0".
4
Clock data setting - Set the clock data to "01:01:00 (Thursday), April 01,
2010" using the following registers.
RTCYD Set it to "0x10".
RTCMOD Set it to "0x04".
RTCDD Set it to "0x01".
RTCWD Set it to "0x04".
RTCHD Set it to "0x01".
RTCMID Set it to "0x01".
RTCSD Set it to "0x00".
5 Periodic interrupt enabled RTCCIRQ Set the CIRQMIEN bit to "1".
6 All maskable interrupts disabled PSW * Set the MIE bit to "0".
7
Interrupt level setting PERI0ICR * Set the PERI0LV1-0 bits to "00".
Clear the corresponding interrupt request bit of
PERI0DT register, if it may have already been set.
Refer to [3.1.5 Set up procedure for Interrupt control
register for peripheral function group]
8 Periodic Interrupt enabled PERI0EN * Set the PERI0EN4 bit to "1".
9 Maskable interrupts enabled PSW * Set the MIE bit to "1".
10
RTC starts RTCCTR Set the CLKEN bit to "1".
The RTC starts.
* For PSW, refer to [Chapter 2 CPU].
For PERI0ICR and PERI0EN, refer to [Chapter 3 Interrupts].