English
Language : 

TMP88FW45FG Datasheet, PDF (86/276 Pages) Toshiba Semiconductor – 8 Bit Microcontroller
8. 16-Bit TimerCounter 1 (TC1)
8.3 Function
TMP88FW45FG
8.3.2 External Trigger Timer Mode
In the external trigger timer mode, the up-counter starts counting by the input pulse triggering of the TC1
pin, and counts up at the edge of the internal clock. For the trigger edge used to start counting, either the rising
or falling edge is defined in TC1CR<TC1S>.
• When TC1CR<METT1> is set to “1” (trigger start and stop)
When a match between the up-counter and the TC1DRA value is detected after the timer starts, the
up-counter is cleared and halted and an INTTC1 interrupt request is generated.
If the edge opposite to trigger edge is detected before detecting a match between the up-counter
and the TC1DRA, the up-counter is cleared and halted without generating an interrupt request.
Therefore, this mode can be used to detect exceeding the specified pulse by interrupt.
After being halted, the up-counter restarts counting when the trigger edge is detected.
• When TC1CR<METT1> is set to “0” (trigger start)
When a match between the up-counter and the TC1DRA value is detected after the timer starts, the
up-counter is cleared and halted and an INTTC1 interrupt request is generated.
The edge opposite to the trigger edge has no effect in count up. The trigger edge for the next count-
ing is ignored if detecting it before detecting a match between the up-counter and the TC1DRA.
Since the TC1 pin input has the noise rejection, pulses of 4/fc [s] or less are rejected as noise. A pulse width
of 12/fc [s] or more is required to ensure edge detection.
Example 1 :Generating an interrupt 1 ms after the rising edge of the input pulse to the TC1 pin
(fc =20 MHz, CGCR<DV1CK> = “1”)
LDW
(TC1DRA), 007DH
; 1ms ÷ 27/fc = 7DH
DI
; IMF= “0”
SET
(EIRD). 2
; Enables INTTC1 interrupt
EI
; IMF= “1”
LD
(TC1CR), 00001000B
; Selects the source clock and mode
LD
(TC1CR), 00111000B
; Starts TC1 external trigger, METT1 = 0
Example 2 :Generating an interrupt when the low-level pulse with 4 ms or more width is input to the TC1 pin
(fc =20 MHz, CGCR<DV1CK> = “1”)
LDW
(TC1DRA), 0138H
; 4 ms ÷ 28/fc = 0138H
DI
; IMF= “0”
SET
(EIRD). 2
; Enables INTTC1 interrupt
EI
; IMF= “1”
LD
(TC1CR), 00000100B
; Selects the source clock and mode
LD
(TC1CR), 01110100B
; Starts TC1 external trigger, METT1 = 0
Page 74