2-49
3874 Group User's Manual
APPLICATION
2.3 Timer X and timer Y
2.3.8 Notes on use
Notes on using for each mode of timer X are described below.
(1)
Common to all modes
s Reading/Writing of timer X
q When reading or writing to timer X, be sure to execute to both timer X (high-order) and timer
X (low-order). When reading a value from timer X, read it in order of timer X (high-order) and
timer X (low-order) following. When writing a value to timer X, write in order of timer X (low-
order) and timer X (high-order) following. If the following operations are performed to timer X,
unexpected operation may occur.
Write operation before execution of timer X (low-order) reading
Read operation before execution of timer X (high-order) writing
When writing for the latch only, if writing timing for the high-order latch is the almost same as
the underflow timing, unexpected value may be set in the high-order counter.
s Division ratio of timer X
When a value n (0 to FFFF16) is written to timer X, the division ratio is 1/(n+1).
s Select of CNTR0 interrupt active edge
Setting the CNTR0 active edge switch bit affects on the active edge of an interrupt. Consequently,
a CNTR0 interrupt request may occur by setting the CNTR0 active edge switch bit. As a countermeasure
against the above, switch the active edge after disabling the CNTR0 interrupt, and set “0” to the
CNTR0 interrupt request bit following.
(2)
Pulse output mode
q Set “1” to bit 4 (CNTR0 pin) of the port P5 direction register (output mode).
q When bit 4 (CNTR0 pin) of the port P5 register is read, the value of the port register are not
read out, but the output value of the pin is read out.
(3)
Event counter mode
q Set “0” to bit 4 (CNTR0 pin) of the port P5 direction register (input mode).
(4)
Pulse width measurement mode
q Set bit 4 (CNTR0 pin) of the port P5 direction register to “0” (input mode).
q When reading bit 4 of port P5, the value is “1” at “H” level input or “0” at “L” level input
regardless of the value of the CNTR0 active edge switch bit of the timer X mode register.
(5)
Real time port function
q Port P56 (RTP0 pin) and port P57 (RTP1 pin) function as a normal I/O port after reset released.
When using ports P56 and P57 as real time port function pins, set “1” to the corresponding port
direction register to be the output mode.
q Do not switch the pins which is used to the real time port to the input mode during operation.