Renesas M16C/64A Series User Manual page 810

Table of Contents

Advertisement

M16C/64A Group
32.15.4 Time Reading Procedure in Real-Time Clock Mode
In real-time clock mode, read time data bits
data is updated).
When reading multiple registers, if data is rewritten between reading registers, an errant time will be
read. To prevent this, use one of the following steps when reading:
Using an interrupt
In the real-time clock periodic interrupt routine, read the values necessary from the appropriate
time data bits.
Monitoring by a program 1
Monitor the IR bit in the RTCTIC register by a program and read necessary values of time data bits
after the IR bit becomes 1 (periodic interrupt requested).
Monitoring by a program 2
Read the time data according to Figure 32.11 "Time Data Reading".
Figure 32.11 Time Data Reading
Using read results if they are the same value twice
(1) Read the values necessary from time data bits.
(2) Read the same bit as (1) and compare the contents.
(3) If the contents match, adopt that value as the correct value. If the contents do not match, repeat
until the read contents match with the previous contents.
Also, when reading multiple registers, read them as continuously as possible.
Note:
1.
Time data bits are as follows:
Bits SC12 to SC10 and SC03 to SC00 in the RTCSEC register
Bits MN12 to MN10 and MN03 to MN00 in the RTCMIN register
Bits HR11 to HR10 and HR03 to HR00 in the RTCHR register
Bits WK2 to WK0 in the RTCWK register
The RTCPM bit in the RTCCR1 register
R01UH0136EJ0210 Rev.2.10
Jul 31, 2012
(1)
when the BSY bit in the RTCSEC register is 0 (not while
Time data reading start
The BSY bit in the
RTCSEC register is
No (updating)
0 (not while data is
Time data reading
The BSY bit in the
RTCSEC register is 0
(not while data is
No (updating)
Time data reading end
updated)
Yes (not updating)
updated)
Yes (not updating)
32. Usage Notes
Page 777 of 800

Advertisement

Table of Contents
loading

Table of Contents