
R8C/38T-A Group
18. Timer RE2
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0241EJ0010 Rev.0.10
Page 341 of 730
Aug 05, 2011
Set the PROTECT bit in the TREPRC register to 1 (write enabled) before rewriting the PM bit.
Read or write to the PM bit when the BSY bit in the TRESEC register is 0 (data not being updated).
The PM bit is enabled when the HR24 bit is 0 (12-hour mode).
The PM bit changes as follows during count operation.
Changes to 0 when the PM bit is 1 (p.m.) and the clock increments from 11:59:59 to 00:00:00.
Changes to 1 when the PM bit is 0 (a.m.) and the clock increments from 11:59:59 to 00:00:00.
Figure 18.3
Definition of Time Representation
When the HR24 bit is set to 0 (12-hour mode), the TREHR register counts from 0 to 11. When this bit is set to
1 (24-hour mode), the register counts from 0 to 23. Read or write to the HR24 bit when the BSY bit is 0 (data
not being updated).
<When the count starts from 0 a.m. of Saturday on January 1, 2000>
LFLAG, PM, HR24: Bits in TRECR register
HR24 bit = 1
(24-hour mode)
TREHR register
0
1
10
11
12
13
22
23
0
1
2
21
22
23
0
1
2
PM bit
0
HR24 bit = 0
(12-hour mode)
TREHR register
0
1
10
11
0
1
10
11
012
910
11
0
1
2
PM bit
0 (a.m.)
1 (p.m.)
0 (a.m.)
1 (p.m.)
0 (a.m.)
TREWK register
110 (Sat.)
000 (Sun.)
001 (Mon.)
010 (Tue.)
TREDY register
Day 1
Day 2
Day 31
Day 1
TREMON register
January
February
TREYR register
Year 2000
LFLAG bit
1
HR24 bit = 1
(24-hour mode)
TREHR register
3
4
5
21
22
23
0
1
2
21
22
23
0
1
2
PM bit
0
HR24 bit = 0
(12-hour mode)
TREHR register
3
4
5
21
10
11
0
1
2
910
11
0
1
2
PM bit
0 (a.m.)
1 (p.m.)
0 (a.m.)
1 (p.m.)
0 (a.m.)
TREWK register
010 (Tue.)
010 (Tue.)
011 (Wed.)
000 (Sun.)
001 (Mon.)
TREDY register
Day 1
Day 29
Day 1
Day 31
Day 1
TREMON register
February
March
December
January
TREYR register
Year 2000
Year 2001
LFLAG bit
1
0
Noon