R8C/13 Group
12.3 Timer (Timer Z)
12.3.4 Programmable Wait One-shot Generation Mode
In this mode, upon program or external trigger input (input to the INT0 pin), the microcomputer outputs
the one-shot pulse from the TZOUT pin after waiting for a given length of time (see “Table 12.12
Programmable Wait One-shot Generation Mode Specifications”). When a trigger occurs, from this
point, the timer starts outputting pulses only once for a given length of time equal to the set value in the
TZSC register after waiting for a given length of time equal to the set value in the TZPR register.
Figure 12.26 shows the TYZMR and PUM registers in this mode. Figure 12.27 shows an operation
example in this mode.
Table 12.12 Programmable Wait One-shot Generation Mode Specifications
Item
Count source
Count operation
Specification
f1, f2, f8, Timer Y underflow
• Downcounts set value in Timer Z primary
• When a counting of TZPR register underflows, the timer reloads the contents of TZSC
register before continuing counting.
• When a counting of TZSC register underflows, the timer reloads the contents of TZPR
register before completing counting and the TZOS bit is “0”.
• When a count stops, the timer reloads the contents of the reload register before it stops.
Wait time
(n+1)(m+1)/fi
n: set value in PREZ register, m: set value in TZPR register
One-shot pulse output time (n+1)(p+1)/fi
n : set value in PREZ, p: set value in TZSC register
Count start condition
Count stop condition
• Set TZOS bit in TYZOC register to “1” (start one-shot)(1)
• Input active trigger to_I_N___T__0 pin(2)
• When reloading is completed after Timer Z underflows during secondary period
• When TZS bit in TYZMR register is set to “0” (stop counting)
• When TZOS bit in TYZOC register is set to “0” (stop one-shot)
I n half cycles of count source, after count value at counting TZSC register is set "0016"
(at the same time as the TZout output change) [Timer Z interrupt]
Pulse output
Interrupt request
generation timing
TZOUT pin function
Use timer mode when using this pin as a programmable I/O port.
_______
_______
INT0 pin function
Programmable I/O port, INT0 interrupt input or external trigger input
_______
• When the INOSTG bit in the PUM register is set to “0” (INT0 one-shot trigger disabled)
_______
programmable I/O port or INT0 interrupt input
_______
• When the INOSTG bit in the PUM register is set to “1” (INT0 one-shot trigger enabled)
_______
external trigger (INT0 interrupt input)
Read from timer
Write to timer
Count value can be read out by reading TZPR register.
Same applies to PREZ register.
(3)
Value written to TZPR register and PREZ register are written to reload register only
Same applies to TZSC register.
.
Select function
• Output level latch select function
Output level for one-shot pulse waveform is selected by TZOPL bit.
•_I_N___T__0 pin one-shot trigger control function and polarity select function
Trigger input from_I_N___T__0 pin can be set to active or inactive by INOSTG bit. Also, an
active trigger's polarity can be selected by INOSEG bit.
NOTES:
1. The TZS bit in the TYZMR register must be set to "1" (start counting).
2. The TZS bit must be set to "1" (start counting), the INT0EN bit in the INTEN register to "1" (enabling_I_N___T__0 input), and
_____
the INOSTG bit in the PUM register to "1" (INT0 one-shot trigger enabled).
Although the trigger input during counting cannot be acknowledged, the I_N__T__0__ interrupt request is generated.
3. The set values are reflected beginning with the next one-shot pulse after writing to the TZPR register.
Rev.1.20 Jan 27, 2006 page 98 of 205
REJ09B0111-0120