![](http://datasheet.mmic.net.cn/30000/M37540E8FP_datasheet_2359848/M37540E8FP_69.png)
HARDWARE
1-50
7540 Group User’s Manual
NOTES ON PERIPHERAL FUNCTIONS
s Interrupt
When setting the followings, the interrupt request bit may be set to
“1”.
When switching external interrupt active edge
Related register: Interrupt edge selection register (address
003A16)
Timer X mode register (address 2B16)
Timer A mode register (address 1D16)
When not requiring the interrupt occurrence synchronized with
these setting, take the following sequence.
Set the corresponding interrupt enable bit to “0” (disabled).
Set the interrupt edge select bit (active edge switch bit).
Set the corresponding interrupt request bit to “0” after 1 or
more instructions have been executed.
Set the corresponding interrupt enable bit to “1” (enabled).
s Timers
When n (0 to 255) is written to a timer latch, the frequency divi-
sion ratio is 1/(n+1).
When a count source of timer X, timer Y or timer Z is switched,
stop a count of timer X.
s Timer A
CNTR1 interrupt active edge selection
CNTR1 interrupt active edge depends on the CNTR1 active edge
switch bit.
When this bit is “0”, the CNTR1 interrupt request bit is set to “1” at
the falling edge of the CNTR1 pin input signal. When this bit is “1”,
the CNTR1 interrupt request bit is set to “1” at the rising edge of
the CNTR1 pin input signal.
However, in the pulse width HL continuously measurement mode,
CNTR1 interrupt request is generated at both rising and falling
edges of CNTR1 pin input signal regardless of the setting of
CNTR1 active edge switch bit.
s Timer X
CNTR0 interrupt active edge selection
CNTR0 interrupt active edge depends on the CNTR0 active edge
switch bit.
When this bit is “0”, the CNTR0 interrupt request bit is set to “1” at
the falling edge of CNTR0 pin input signal. When this bit is “1”, the
CNTR0 interrupt request bit is set to “1” at the rising edge of
CNTR0 pin input signal.
s Timer Y: Programmable Generation
Waveform Mode
Count set value
In the programmable waveform generation mode, values of TYS,
EXPYP, and EXPYS are valid by writing to TYP because the set-
ting to them is executed all at once by writing to TYP. Even when
changing TYP is not required, write the same value again.
Write timing to TYP
In the programmable waveform generation mode, when the set-
ting 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 simultanesously.
Usage of waveform extension function
The waveform extension function by the timer Y waveform exten-
sion control bit can be used only when “0016” is set to Prescaler Y.
When the value other than “0016” is set to Prescaler Y, be sure to
set “0” to EXPYP and EXPYS.
Timer Y write mode
When using this mode, be sure to set “1” to the timer Y write con-
trol bit to select “write to latch only”.
Timer Y can stop counting by setting “1” to the timer Y count stop
bit in any mode.
Also, when Timer Y underflows, the timer Y interrupt request bit is
set to “1”.
Timer Y reloads the value of latch when counting is stopped by the
timer Y count stop bit. (When timer is read out while timer is
stopped, the value of latch is read. The value of timer can be read
out only while timer is operating.)
s Timer Z: Programmable Waveform
Generation Mode
Count set value
In the programmable waveform generation mode, values of TZS,
EXPZP, and EXPZS are valid by writing to TZP because the set-
ting to them is executed all at once by writing to TZP. Even when
changing TZP is not required, write the same value again.
Write timing to TZP
In the programmable waveform generation mode, when the set-
ting 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 simultanesously.
Usage of waveform extension function
The waveform extension function by the timer Z waveform exten-
sion control bit can be used only when “0016” is set to Prescaler Z.
When the value other than “0016” is set to Prescaler Z, be sure to
set “0” to EXPZP and EXPZS. Also, when the timer Y underflow is
selected as the count source, the waveform extension function
cannot be used.
Timer Z write mode
When using this mode, be sure to set “1” to the timer Z write con-
trol bit to select “write to latch only”.
NOTES ON PERIPHERAL FUNCTIONS