English
Language : 

M16C1N Datasheet, PDF (114/238 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/10 SERIES
M16C/1N Group
12. Timers
12.4.4 Programmable Wait One-shot Generation Mode
In this mode, upon software command or external trigger input (input to the INT0 pin), the microcom-
puter outputs the one-shot pulse from the TZOUT pin after waiting for a given length of time. (See Table
12.13) When a trigger occurs, from this point, the timer starts outputting pulses only once for a given
length of time equal to the Timer Z primary set value after waiting for a given length of time equal to the
Timer Z primary set value. Figure 16.29 shows the Timer Y, Z mode register and Timer Y, Z waveform
output control register in this mode. Figure 12.30 shows the Timer Z operation example in this mode.
Table 12.13 Specifications of programmable wait one-shot generating mode
Item
Specification
Count source
f1, f8, Timer Y underflow, fC32
Count operation
• Down counts the set value of Timer Z primary
• When Timer Z primary underflows, the contents of Timer Z secondary is reloaded be-
fore continuing counting.
• When Timer Z secondary underflows, the contents of Timer Z primary is reloaded be-
fore stopping counting.
• When a counting stops, the timer reloads the contents of the reload register before it stops.
Wait time
(n+1) x (m+1)/fi, n: Set value of Prescaler Z, m: Set value of Timer Z primary
One-shot pulse output time (n+1) x (l+1))/fi, n: Set value of Prescaler Z, l: Set value of Timer Z secondary
Count start condition
• Timer Z one-shot start bit is set (=1) (Note 1)
• Valid trigger is input to INT0 pin (Note 2)
Count stop condition
• When reloading is completed after count value at counting Timer Z secondary was set to "0016"
• When Count start flag is reset (=0)
• Timer Z one-shot start bit is reset (=0) (Note 3)
Interrupt request generation timing When count value at counting Timer Z secondary becomes "0016"
TZOUT pin function
Pulse output
INT0 pin function
Programmable I/O port, external interrupt input pin, or external trigger input pin
Read from timer
Count value can be read out by reading Timer Z primary register.
Same applies to Prescaler Z register.
Write to timer
When a value is written to Timer Z primary register, it is written to only reload register.
Same applies to Prescaler Z register. (Note 4)
Select function
• Output level latch select function
The output level of one-shot pulse waveform is selectable.
• INT0 pin one-shot trigger control function and polarity select function
The trigger input from the INT0 pin can be set to valid or invalid. Also, the valid trigger's
polarity is selectable: rising edge, falling edge, or rising and falling both edges.
• Waveform extend function (Note 5)
Waiting time and one-shot pulse waveform can each be extended 0.5 cycles of the
count source.
Waiting time when waveform extended: (n+1) x (2x(m+1)+TZPUM0)/2fi
One-shot pulse output time when waveform extended: (n+1) x (2x(l+1)+TZPUM1)/2fi
n: set value of Prescaler Z, m: set value of Timer Z primary, l: set value of Timer Z secondary
TZPUM0: Timer Z primary waveform extension control bit, TZPUM1: Timer Z secondary waveform extension control bit
Note 1: Count start flag must have been set to "1".
_______
_______
Note 2: Count start flag must have been set to "1", INT0 input enable bit [INT0EN] to "1", and INT0 pin one-shot trigger
control bit to "1".
Note 3: When the count is stopped by writing "0" to the count start flag or Timer Z one-shot start bit, the Timer Z interrupt
request bit becomes "1" and an interrupt may occur. Thus, interrupts must be disabled before the count is
stopped. Furthermore, set the Timer Z interrupt request bit to "0" before starting counting again.
Note 4: Each set value becomes effective by writing to the Timer Z primary register. And the set values are reflected
collectively beginning with the next one-shot pulse after writing to the Timer Z primary.
Note 5: When using the waveform extend function, the Prescaler Z register must be set to "0016".
When selecting Timer Y underflow and f1 for the count source, the waveform extend function cannot be used.
Rev.1.00 Oct 20, 2004 page 102 of 222
REJ09B0007-0100Z