BAT32G1x9 user manual | Chapter 6 Universal timer unit Timer4/8
206 / 1149
Rev.1.02
FFFFH
0000H
a
b
a+1
b+1
6.8.6
Runs as a delay counter
The count can be decremented by the effective edge detection (external event) of the TImn pin input and
intTMmn is generated at arbitrary set intervals
(Timer interrupt).
During the period when the TEmn bit is "1", the TSmn position "1" can be changed by software, the count can
be decremented, and intTMmn (timer interrupt) can be generated at any set interval.
The interrupt generation period can be calculated using the following calculation equation:
In single-count mode, the timer count register mn (TCRmn) is used as a decrement counter.
If the channel start trigger bit (TSmn, TSHm1, TSHm3) of the timer channel start register m(TSm) is set to "1"
TEmn
Bits, TEHm1 bits, and TEHm3 bits become "1" and enter a valid edge detection wait state for the TImn pin. By
detecting the valid edge of the TImn pin input, the operation of the TCRmn register begins and the value of the timer
data register mn (TDRmn) is loaded. The TCRmn register decrements the count from the value of the loaded
TDRmn register by counting the clock. If TCRmn becomes "0000H", INTMmn is output and counts are stopped
before a valid edge of the next TImn pin input is detected.
The TDRmn register can be rewritten at any time, and the value of the rewritten TDRmn register is valid from
the next cycle.
Figure 6-57 an example of the basic timing of the operation of the delay counter
TSmn
TEmn
TImn
TCRmn
TDRmn
INTTMmn
Note: 1.m: unit number (m=0,1) n: channel number (m=0: n=0~3, m=1: n=0~7).
2. TSmn : The bitn of the timer channel start register
m(TSm
).
TEmn : The timer channel enable
bitn
of the status register
m(TEm
).
TImn
:
The TImn
pin input signal
TCRmn: Timer count register
mn
(TCRmn).
TDRmn: Timer data register
mn
(TDRmn).
InTT
Mmn
(Hours
interrupt)
of the production
cycle
=
counting
clocks Period
×
(TDRmn
set
+1).