![](http://datasheet.mmic.net.cn/230000/7540_datasheet_15567442/7540_175.png)
7540 Group User
’
s Manual
2-100
APPLICATION
2.5 Timer Y and timer Z
The waveform extension function by the timer Z waveform extension control bits can be used only
when
“
00
16
”
is set to Prescaler Z.
When the value other than
“
00
16
”
is set to Prescaler Z, be sure to set
“
0
”
to EXPZP. Also, when
the timer Y underflow is selected as the timer Z count source, the waveform extension function
cannot be used.
An example of a measurement is shown below.
ex.) The underflow of timer is stored by polling etc. using timer Z interrupt.
Writing to primary is performed in by judging that there is no problem if the underflow by
secondary is completed with reference to primary write operation before.
(Depending on a primary setting value, primary write timing, software and timing of external
trigger to INT
0
pin, it may be impossible.)
When using this mode, be sure to set
“
1
”
to the timer Z write control bit to select
“
write to latch
only
”
.
In order to use TZ
OUT
pin, set
“
1
”
to bit 2 of the port P0 direction register (output mode).
Stop Timer Z to change the INT
0
pin one-shot trigger control bit and INT
0
pin one-shot trigger
active edge selection bit.
(4) Programmable wait one-shot generation mode (timer Z)
In the programmable wait one-shot generation mode, values of TZS, EXPZP and EXPZS are valid
by writing to TZP. Even when changing TZP is not required, write the same value again.
An example of a measurement is shown below.
ex.) The underflow by the primary and the underflow by secondary are stored by polling etc. using
timer Z interrupt.
Writing to primary is performed in by judging that there is no problem if the underflow by
secondary is completed with reference to primary write operation before.
(Depending on a primary setting value, primary write timing, software and timing of external
trigger to INT
0
pin, it may be impossible.)
In the programmable wait one-shot generation mode, when the setting value is changed while the
waveform is output, set by software in order not to execute the writing to TZP and the timing of
timer underflow during the secondary interval simultaneously.
The waveform extension function by the timer Z waveform extension control bit can be used only
when
“
00
16
”
is set to Prescaler Z.
When the value other than
“
00
16
”
is set to Prescaler Z, be sure to set
“
0
”
to EXPZP and EXPZS.
Also, when the timer Y underflow is selected as the timer Z count source, the waveform extension
function cannot be used.
When using this mode, be sure to set
“
1
”
to the timer Z write control bits to select
“
write to latch
only
”
.
When TZS is read out, the undefined value is read out. However, while Timer Z counts the setting
value of TZS (during one-shot output), the count value during the secondary interval can be
obtained by reading TZP.
In order to use TZ
OUT
pin, set
“
1
”
to bit 2 of the port P0 direction register (output mode).
Stop Timer Z to change the INT
0
pin one-shot trigger control bit and INT
0
pin one-shot trigger
active edge selection bit.