
254
CHAPTER 11 16-BIT RELOAD TIMER
11.6.3 Event Count Mode
The 16-bit reload timer count downs the 16-bit down counter every time it detects a
valid edge of pulse input to the TIN pin and outputs an interrupt request when an
underflow occurs (change from "0000H" to "FFFFH"). It can also output a toggle or
square waveform from the T0 pin.
s Event Count Mode
When the software trigger bit (TRG) is set to "1" while the count enable bit (CNTE) of the timer
control status register (TMCSR) is set to "1", a value stored in the 16-bit reload register
(TMRLR0/TMRHR0, TMRLR1/TMRHR1) is loaded into the 16-bit down counter and countdown
occurs every time a valid edge (rising, falling, or both edges) of pulse input to the TIN pin
(external count clock) is detected. When both the CNTE bit and the software trigger bit (TRG)
are set to "1", countdown starts as soon as counting is enabled.
r Operation in reload mode
When an underflow of the 16-bit down counter occurs (change from "0000H" to "FFFFH"), a
value stored in the 16-bit reload register (TMRLR0/TMRHR0, TMRLR1/TMRHR1) is loaded into
the 16-bit down counter and countdown continues.
An interrupt request is output when an underflow of the 16-bit down counter occurs (change
from "0000H" to "FFFFH") while the underflow interrupt request flag bit (UF) of the timer control
status register (TMCSR) is set to "1" and the underflow interrupt request enable bit (INTE) is set
to "1".
The timer can also output from the TO pin a toggle waveform, which is inverted for each
underflow.
Figure 11.6-10 Count Operation in Reload Mode (Event Count Mode)
Note:
Specify 22/
φ or more for the H and L widths of the pulse input to the TIN pin.
TIN pin
(External count clock)
Counter
Data load signal
CNTE bit
UF bit
TRG bit
0000H
TO pin
T*
-1
T: Machine cycle
* It takes 1T time from trigger input to loading of the reload data.
Reload data