
CHAPTER 8 16-BIT TIMER/EVENT COUNTER Q
Preliminary User’s Manual U16541EJ1V0UM
294
8.5.4
External trigger pulse mode (TQ0MD2 to TQ0MD0 = 010)
In the external trigger pulse mode, setting TQ0CE = 1 causes external trigger input (TIQ00 pin input) wait with the
16-bit counter stopped at FFFFH. The count-up operation starts upon detection of the external trigger input (TIQ00
pin input) edge.
Regarding TOQ0m output control, the reload register (TQ0CCRm) is used as the duty setting register and the
compare register (TQ0CCR0) is used as the cycle setting register.
The TQ0CCRn register can be rewritten when TQ0CE = 1.
In order for the setting value when the TQ0CCRn register is rewritten to become the 16-bit counter comparison
value (in other words, in order for this value to be reloaded to the CCRn buffer register), it is necessary to rewrite
TQ0CCR0 and finally write to the TQ0CCR1 register before the 16-bit counter value and the TQ0CCR0 register value
match. Thereafter, the value of the TQ0CCR0 is reloaded upon a TQ0CCR0 register match.
Whether to enable or disable the next reload timing is controlled by writing to the TQ0CCR1 register. Thus even
when wishing only to rewrite the value of the TQ0CCR0 register, also write the same value to the TQ0CCR1 register.
Reload is disabled even when only the TQ0CCR0 register is rewritten. To stop timer Q, set TQ0CE = 0. If the
external trigger (TIQ00 pin input) edge is detected several times in the external trigger pulse mode, the 16-bit counter
is cleared at the edge detection timing and count-up starts. To realize the same function (software trigger pulse mode)
as external trigger pulse mode using a software trigger instead of external trigger input (TIQ00 pin input), set the
TQ0EST bit of the TQ0CTL1 register to 1 so that the software trigger is output. The external trigger pulse waveform is
output from TOQ0m.
Since the TQ0CCRn register has its function fixed to that of a compare register in the external trigger pulse mode,
they cannot be used for capture operation in this mode.
Caution
In the external trigger pulse mode, select the internal clock (TQ0EEE bit of TQ0CTL1 register = 0)
for the count clock.
Remarks 1. For the reload operation when TQ0CCRn is rewritten during timer operation, refer to 8.5.6 PWM
mode.
2. n = 0 to 3
m = 1 to 3