254
Counting mode selection
Select counter clock
Periodic counter
Select counter
clear source
Select output
compare register
Set period
Start counting
Start counting
Counting?
No
Yes
Free-running counter
Periodic counter
Free-running counter
(5)
(5)
(4)
(3)
(2)
(1)
Figure 10.14 Procedure for Selecting the Counting Mode
•
Free-running count and periodic count
A reset of the counters for channels 0–4 leaves them all in free-running mode. When a
corresponding bit in TSTR is set to 1, the corresponding timer counter operates as a free-
running counter and begins to increment. When the count wraps around from H'FFFF to
H'0000, the overflow flag (OVF) in the timer status register (TSR) is set to 1. If the OVIE bit
in the timer's corresponding interrupt enable register (TIER) is set to 1, an interrupt request
will be sent to the CPU. After TCNT overflows, counting continues from H'0000. Figure 10.15
shows an example of free-running counting.
Periodic counter operation is obtained for a given channel's TCNT by selecting compare match
as a TCNT clear source. (Set GRA or GRB for period setting to output compare register and
select counter clear upon compare match using the CCLR1 and CCLR0 bits in the timer
control register (TCR).) After setting, TCNT begins incrementing as a periodic counter when
the corresponding bit in TSTR is set to 1. When the count matches GRA or GRB, the
IMFA/IMFB bit in TSR is set to 1 and the counter is automatically cleared to H'0000. If the
IMIEA/IMIEB bit of the corresponding TIER is set to 1 at this point, an interrupt request will
be sent to the CPU. After the compare match, TCNT continues counting from H'0000. Figure
10.16 shows an example of periodic counting.
Содержание 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 ...