206
12.2.7
Timer Counter (TCNT)
Bit
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Initial value
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Read/Write
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
TCNT is a 16-bit read/write up-counter that counts the pulses input from the internal or external
clock source. The clock source is selected by bits CKS2 to CKS0 in TCRW.
TCNT can be cleared to H'0000 through a compare match with GRA by setting CCLR of TCRW
to 1.
When TCNT overflows (changes from H'FFFF to H'0000), the OVF flag in TCRW is set to 1, and
if OVIE in TIERW is set to 1 at this time, an interrupt request is sent to the CPU.
TCNT must be always read or written in 16-bit units; 8-bit access is not allowed.
TCNT is initialized to H'0000 by a reset.
12.2.8
General Registers A to D (GRA to GRD)
Bit
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Initial value
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Read/Write
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
Each general register is a 16-bit read/write register that can function as either an output compare
register or an input capture register. The function is selected by settings in TIOR0 and TIOR1.
When a general register is used as an output compare register, its value is constantly compared
with the TCNT value. When the two values match (a compare match), the corresponding flag
(IMFA, IMFB, IMFC, or IMFD) in TSRW is set to 1. If the corresponding interrupt enable bit
(IMIEA, IMIEB, IMIEC, or IMIED) in TIERW is set to 1 at this time, an interrupt request is sent
to the CPU. Compare match output can be selected in TIOR0 and TIOR1.
When a general register is used as an input capture register, an external input capture signal is
detected and the current TCNT value is stored in the general register. The corresponding flag
(IMFA, IMFB, IMFC, or IMFD) in TSRW is set to 1. If the corresponding interrupt enable bit
(IMIEA, IMIEB, IMIEC, or IMIED) in TIERW is set to 1 at this time, an interrupt request is sent
to the CPU. The edges of the input capture signal are selected in TIOR0 and TIOR1.
Summary of Contents for H8/3660
Page 4: ......
Page 26: ...10 ...
Page 82: ...66 ...
Page 152: ...136 ...
Page 154: ...138 ...
Page 260: ...244 ...