![](http://datasheet.mmic.net.cn/230000/7540_datasheet_15567442/7540_298.png)
7540 Group User’s Manual
3-77
APPENDIX
3.3 Notes on use
3.3.7 Notes on timer Y and timer Z
Notes on using each mode of Timer Y and Timer Z are described below.
(1) Timer mode (timer Y and timer Z)
In the timer mode, TYP and TYS is not used.
(2) Programmable waveform generation mode (timer Y and timer Z)
In the programmable waveform generation mode, values of TYS, EXPYP, and EXPYS are valid
by writing to TYP because the setting to them is executed all at once by writing to TYP. Even
when changing TYP is not required, write the same value again.
In the programmable waveform generation mode, when the setting value is changed while the
waveform is output, set by software in order not to execute the writing to TYP and the timing of
timer underflow during the secondary interval simultaneously.
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 Y 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 and a secondary setting values, and primary write timing, it may
be impossible.)
The waveform extension function by the timer Y waveform extension control bits can be used only
when “00
16
” is set to Prescaler Y.
When the value other than “00
16
” is set to Prescaler Y, be sure to set “0” to EXPYP and EXPYS.
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 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 Y write control bit to select “write to latch
only”.
When TYS is read out, the undefined value is read out. However, while timer Y counts the setting
value of TYS, the count value during the secondary interval can be obtained by reading the timer
Y primary.
In order to use TY
OUT
pin, set “1” to bit 1 of the port P0 direction register (output mode).
(3) Programmable one-shot generation mode (timer Z)
In the programmable one-shot generation mode, the value of EXPZP becomes valid by writing
to TZP. Even when changing TZP is not required, write the same value again.
In the programmable 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 simultaneously.