
CHAPTER 8 16-BIT TIMER/EVENT COUNTER 0
Preliminary User’s Manual U16895EJ1V0UD
307
8.4.6 One-shot pulse output operation
16-bit timer/event counter 0n can output a one-shot pulse in synchronization with a software trigger or an external
trigger (TI0n0 pin input).
Setting procedure
The basic operation setting procedure is as follows.
<1> Set the count clock using the PRM0n register and SELCNT1 register.
<2> Set the CRC0n register (refer to Figures 8-23 and 8-25 for the setting value).
<3> Set the TOC0n register (refer to Figures 8-23 and 8-25 for the setting value).
<4> Set any value to the CR0n0 and CR0n1 registers.
<5> Set the TMC0n register: Start operation (refer to Figures 8-23 and 8-25 for the setting value).
Remarks 1. For the alternate-function pin (TO0n) settings, refer to Table 4-14 Settings When Port Pins Are
Used for Alternate Functions.
2. For INTTM0n0 interrupt enable, refer to CHAPTER 19 INTERRUPT/EXCEPTION PROCESSING
FUNCTION.
(1) One-shot pulse output with software trigger
A one-shot pulse can be output from the TO0n pin by setting the TMC0n, CRC0n, and TOC0n registers as
shown in Figure 8-23, and by setting the TOC0n.OSPT0n bit to 1 by software.
By setting the OSPT0n bit to 1, 16-bit timer/event counter 0n is cleared and started, and its output becomes
active at the count value (N) set in advance to the CR0n1 register. After that, the output becomes inactive at
the count value (M) set in advance to the CR0n0 register
Note.
Even after the one-shot pulse has been output, 16-bit timer/event counter 0n continues its operation. To stop
16-bit timer/event counter 0n, the TMC0n.TMC0n3 and TMC0n.TMC0n2 bits must be cleared to 00.
Note The case where N < M is described here. When N > M, the output becomes active with the CR0n0
register and inactive with the CR0n1 register.
Cautions 1. Do not set the OSPT0n bit to 1 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 CR0n0 and CR0n1 registers cannot be changed during timer count
operation.
Remark
n = 0, 1