
CHAPTER 7 16-BIT TIMER/EVENT COUNTERS 00 TO 05
User
’
s Manual U15862EJ3V0UD
340
7.4.6 One-shot pulse output operation
The one-shot pulse output is valid only for 16-bit timer/event counters 00, 01, 04, and 05.
16-bit timer/event counter 0n can output a one-shot pulse in synchronization with a software trigger or an external
trigger (TI0k0 pin input).
Setting procedure
The basic operation setting procedure is as follows.
<1> Set the count clock using the PRM0m register.
<2> Set the CRC0m register (see
Figures 7-23
and
7-25
for the setting value).
<3> Set the TOC0m register (see
Figures 7-23
and
7-25
for the setting value).
<4> Set any value to the CRC0m0 and CRC0m1 registers.
<5> Set the pins to the TO0m0 pin mode (see
CHAPTER 4 PORT FUNCTIONS
).
<6> Enable the INTTM0m0 interrupt (see
CHAPTER 19 INTERRUPT/EXCEPTION PROCESSING FUNCTION
for details).
<7> Set the TMC0m register: Start operation (see
Figures 7-23
and
7-25
for the setting value).
(1) One-shot pulse output with software trigger (16-bit timer/event counters 00, 01, 04, and 05 only)
A one-shot pulse can be output from the TO0m pin by setting 16-bit timer mode control register 0m (TMC0m),
capture/compare control register 0m (CRC0m), and 16-bit timer output control register 0m (TOC0m) as shown
in Figure 7-23, and by setting bit 6 (OSPT0m) of the TOC0m register to 1 by software.
By setting the OSPT0m bit to 1, 16-bit timer/event counter 0m is cleared and started, and its output becomes
active at the count value (N) set in advance to 16-bit timer capture/compare register 0m1 (CR0m1). After that,
the output becomes inactive at the count value (M) set in advance to 16-bit timer capture/compare register
0m0 (CR0m0)
Even after the one-shot pulse has been output, the TM0m register continues its operation. To stop the TM0m
register, the TMC0m3 and TMC0m2 bits of the TMC0m register must be set to 00.
Note
.
Note
The case where N < M is described here. When N > M, the output becomes active with the CR0m0
register and inactive with the CR0m1 register.
Cautions 1. Do not set the OSPT0m bit while the one-shot pulse is being output. To output the one-
shot pulse again, wait until the current one-shot pulse output is completed.
2. The value of the CR0m0 and CR0m1 registers cannot be changed during timer count
operation. However, the CR0m1 register value can be changed in the PPG output mode.
For details, refer to 7.4.2 PPG output operation.
Remark
m = 0, 1, 4, 5
k = 4, 5