![Renesas RL78/G1P Скачать руководство пользователя страница 218](http://html1.mh-extra.com/html/renesas/rl78-g1p/rl78-g1p_hardware-user-manual_1440450218.webp)
RL78/G1P
CHAPTER 6 TIMER ARRAY UNIT
R01UH0895EJ0100 Rev.1.00
199
Nov 29, 2019
6.8.5 Operation as delay counter
It is possible to start counting down when the valid edge of the TImn pin input is detected (an external event), and then
generate INTTMmn (a timer interrupt) after any specified interval.
It can also generate INTTMmn (timer interrupt) at any interval by making a software set TSmn = 1 and the count down
start during the period of TEmn = 1.
The interrupt generation period can be calculated by the following expression.
Generation period of INTTMmn (timer interrupt) = Period of count clock
(Set value of TDRmn + 1)
Timer count register mn (TCRmn) operates as a down counter in the one-count mode.
When the channel start trigger bit (TSmn, TSHm1, TSHm3) of timer channel start register m (TSm) is set to 1, the
TEmn, TEHm1, TEHm3 bits are set to 1 and the TImn pin input valid edge detection wait status is set.
Timer count register mn (TCRmn) starts operating upon TImn pin input valid edge detection and loads the value of
timer data register mn (TDRmn).
The TCRmn register counts down from the value of the TDRmn register it has loaded, in
synchronization with the count clock. When TCRmn = 0000H, it outputs INTTMmn and stops counting until the next TImn
pin input valid edge is detected.
The TDRmn register can be rewritten at any time. The new value of the TDRmn register becomes valid from the next
period.
Figure 6-57. Block Diagram of Operation as Delay Counter
Interrupt signal
(INTTMmn)
Interrupt
controller
Operation clock
Note
CKm0
CKm1
TSmn
Timer counter
register mn (TCRmn)
Timer data
register mn (TDRmn)
Edge
detection
TImn pin
TNFENmn
Noise
filter
Clo
ck s
e
le
ct
io
n
T
rigg
e
r se
le
ct
io
n
NFEN1
register
Note
For using channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Remark
m: Unit number (m = 0), n: Channel number (n = 0 to 3)