R01UH0092EJ0110 Rev.1.10
Page 376 of 807
Jul 31, 2012
M16C/64C Group
20. Real-Time Clock
RTCRST (Real-Time clock reset bit) (b4)
When setting this bit to 0 after setting it to 1, the following are set automatically:
•
The values are reset in registers RTCSEC, RTCMIN, RTCHR, RTCWK, RTCCR2, RTCCSR,
RTCCSEC, RTCCMIN, and RTCCHR.
•
Bits TCSTF, RTCPM, H12H24, and TSTART in the RTCCR1 register become 0.
RTCPM (a.m./p.m. bit) (b5)
Write to the RTCPM bit when bits TSTART and TCSTF in the RTCCR1 register are both 0 (count
stopped). Read this bit when the BSY bit in the RTCSEC register is 0 (not while data is updated).
The RTCPM bit is enabled when the H12H24 bit is 0 (12-hour mode) or 1 (24-hour mode). Set the
RTCPM bit as shown below to set the time while the H12H24 bit is 1:
•
Set the RTCPM bit to 0 when bits HR11 to HR10 and HR03 to HR00 in the RTCHR register are 00
to 11.
•
Set the RTCPM bit to 1 when bits HR11 to HR10 and HR03 to HR00 in the RTCHR register are 12
to 23.
The RTCPM bit changes as follows while counting:
•
Becomes 0 when the RTCPM bit is 1 (p.m.) while the clock increments from 11:59:59 (23:59:59 for
24-hour mode) to 00:00:00.
•
Becomes 1 when the RTCPM bit is 0 (a.m.) while the clock increments from 11:59:59 to 00:00:00
(12:00:00 for 24-hour mode).
Figure 20.2 shows Time Representation.
Figure 20.2
Time Representation
H12H24 (Operating mode select bit) (b6)
Write to the H12H24 bit when bits TSTART and TCSTF in the RTCCR1 register are both 0 (count
stopped).
0
1
2
3
4
5
7
9
11
13
15
17
6
8
10
12
14
16
0
1
2
3
4
5
7
9
11
1
3
5
6
8
10
0
2
4
Contents of RTCPM bit
0 (a.m.)
1 (p.m.)
18
19
20
21
22
23
1 (p.m.)
7
9
11
6
8
10
Noon
Contents
of
RTCHR
Register
Contents in RTCWK register
000 (Day 1)
Contents of RTCPM bit
Contents
of
RTCHR
Register
Contents in RTCWK register
000 (Day 1)
0
1
2
3
0
1
2
3
...
...
Bits RTCPM and H12H24 : Bits in the RTCCR1 register.
The above assumes the count starts from 00:00 (12 a.m.) of day 1.
Date changes
H12H24 bit = 1
(24-hour mode)
H12H24 bit = 0
(12-hour mode)
H12H24 bit = 1
(24-hour mode)
H12H24 bit = 0
(12-hour mode)
001 (Day 2)
0 (a.m.)
...
...
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...