239
10.2.6
Timer Counters (TCNT)
The ITU has five 16-bit timer counters (TCNT), one for each channel.
Each TCNT is a 16-bit read/write counter that counts by input from a clock source. The clock
source is selected by timer prescaler bits 2–0 (TPSC2–TPSC0) in the timer control register (TCR).
TCNT0 and TCNT 1 are strictly up-counters. Up/down-counting occurs for TCNT2 when phase
counting mode is selected, or for TCNT3 and TCNT 4 when complementary PWM mode is
selected. In other modes, they are up-counters.
TCNT can be cleared to H'0000 by compare match with the corresponding general register A or B
(GRA, GRB) or input capture to GRA or GRB (counter clear function).
When TCNT overflows (changes from H'FFFF to H'0000), the overflow flag (OVF) in the timer
status register (TSR) is set to 1. The OVF of the corresponding channel TSR is also set to 1 when
TCNT underflows (changes from H'0000 to H'FFFF).
TCNT is connected to the CPU by a 16-bit bus, so it can be written or read by either word access
or byte access. TCNT is initialized to H'0000 by a reset and in standby mode.
Table 10.4
Timer Counters (TCNT)
Channel
Abbreviation
Function
0
TCNT0
Increment counter
1
TCNT1
2
TCNT2
Phase counting mode: Increment/decrement
All others: Increment
3
TCNT3
Complementary PWM mode: Increment/decrement
4
TCNT4
All others: Increment
Bit:
15
14
13
12
11
10
9
8
Bit name:
Initial value:
0
0
0
0
0
0
0
0
R/W:
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Bit:
7
6
5
4
3
2
1
0
Bit name:
Initial value:
0
0
0
0
0
0
0
0
R/W:
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Содержание HD6417032
Страница 21: ......
Страница 35: ...xiv ...
Страница 85: ...50 ...
Страница 101: ...66 ...
Страница 129: ...94 ...
Страница 135: ...100 ...
Страница 343: ...308 ...
Страница 369: ...334 ...
Страница 383: ...348 ...
Страница 475: ...440 ...
Страница 525: ...490 CK RAS CAS TRp TRc TRcc tRASD1 tRASD2 tCASD3 tCASD2 TRr tCSR Figure 20 18 Self Refresh ...
Страница 578: ...543 CK RAS CAS TRp TRc TRcc tRASD1 tRASD2 tCASD3 tCASD2 TRr tCSR Figure 20 62 Self Refresh ...
Страница 689: ...654 ...