![](http://datasheet.mmic.net.cn/280000/M37540E8FP_datasheet_16083919/M37540E8FP_22.png)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
7540 Group
MITSUBISHI MICROCOMPUTERS
22
PRELIMINARY
Notice: This is not a final specification.
Some parametric limits are subject to change.
(3)Programmable one-shot generation mode
Mode select
Timer mode is selected by setting timer Z operation mode bits
(b5,b4) of TYZM to “10”.
When this mode is selected, set timer Z write control bit (b6) of
TYZM to “1” (“writing to only latch” selected).
Count source select
The count source is f(X
IN
)/2, f(X
IN
)/16 or timer Y underflow.
Interrupt
When an underflow occurs, timer Z interrupt request bit (b1) of
IREQ2 is set to “1”.
Operation description
After reset release, timer Z is operating because the timer Z count
stop bit (b7) of TYZM is “0”. MCU operates in the programmable
one-shot generation mode when timer Z operation mode bits (b5,
b4) of TYZM is set to “10” after timer Z operation is stopped by
setting b7 of TYZM to “1”.
Timer Z is enabled to accept the one-shot start trigger when “0” is
written to b7 of TYZM after the timer count value is set to the timer
Z primary latch (TZP). In this state, when “1” is written to the timer
Z one-shot start bit (b0) of the one-shot start register (ONS), timer
Z starts count operation, at the same time, the output of TZ
OUT
pin
is inverted. Timer Z counts down the value of TZP and stops after
the output of TZ
OUT
pin is inverted to the same level as the initial
state when an underflow occurs. In this time, the next one-shot
pulse can be output by writing b0 of ONS to “1” because this bit is
initialized to “0”.
The active edge of the output waveform from TZ
OUT
pin is set by
the timer Z output level latch (b5) of PUM. When “0” is set to b5 of
PUM, the initial level of timer at stop is “L” and “H” is output at the
same time when timer starts. “H” is output in the count interval of
TZP, and the output is inverted to “L” and stopped when an under-
flow occurs.
Also, when “1” is set to b5 of PUM, the initial level of timer at stop
is “H” and “L” is output at the same time when timer starts. “L” is
output in the count interval of TZP, and the output is inverted to “H”
and stopped when an underflow occurs.
When the INT0 pin one-shot trigger control bit (b6) of PUM is set
to “1”, the one-shot pulse can be output by using the input of INT0
pin as a trigger. The active edge of the pulse input to INT0 pin as
the trigger can be selected by the INT0 pin one-shot trigger active
edge selection bit (b7) of PUM. The trigger is accepted and the
one-shot pulse is generated by the falling edge of INT0 pin input
when “0” is set to b7 of PUM or the rising edge of INT0 pin input
when “1” is set to the b7 of PUM.
Also, the INT0 interrupt occurs when the trigger is input from the
INT0 pin by setting the INT0 interrupt edge selection bit (b0) of the
interrupt edge selection register (INTEDGE) and the INT0 inter-
rupt enable bit (b2) of the interrupt control register 1 (ICON1). Even
when the trigger by the INT0 pin input is selected, the one-shot
pulse can be output by writing to b0 of ONS.
Also, in this mode, the waveform output interval of the one-shot
pulse can be extended for 0.5 cycle of timer count source clock by
setting the timer Z primary waveform extension control bit (b2) to
“1”. As a result, the waveforms of more accurate resolution can be
output.
When using the programmable one-shot generation mode, note
the following;
Notes on using the programmable one-shot generation mode
When setting and changing TZP and EXPZS, write to TZP at last
because the setting to them is executed all at once by writing to
TZP. Even when TZP is not changed, write the same value. The
value is reloaded to timer at the beginning of the next primary in-
terval.
Set by software in order not to execute the writing to timer Z pri-
mary and the timing of timer underflow simultaneously. When read-
ing the timer Z secondary, the undefined value is read out. How-
ever, while timer counts the setting value of the timer Z secondary,
the count values at the secondary interval can be identified by
reading the timer Z primary.
In this mode, set port P0
2
which is also used as TZ
OUT
pin to output.
B2 of PUM can be used only when “00
16
” is set to prescaler Z and
f(X
IN
)/2 or f(X
IN
)/16 is selected as the timer Z count source.