3874 Group User's Manual
3-56
APPENDIX
3.5 Control Registers
Fig. 3.5.19 Structure of timer X mode register
Timer X mode register
b7 b6 b5 b4 b3 b2 b1 b0
Timer X mode register
(TXM: address 2716)
b
0
Name
0
Functions
At reset R W
Timer X write
control bit
0 : Write value in latch and
counter
1 : Write value in latch only
1
0
Real time port
control bit
0 : Real time port function
invalid
1 : Real time port function valid
2
0
P56 data for real
time port
0 : “0” output
1 : “1” output
3
0
P57 data for real
time port
0 : “0” output
1 : “1” output
7
0
Timer X stop
control bit
0 : Count start
1 : Count stop
6
0
CNTR0 active edge
switch bit
0 : Count at rising edge in
event counter mode
Start from “H” output in
pulse output mode
Measure “H” pulse
width in pulse width
measurement mode
Falling edge active for
CNTR0 interrupt
1 : Count at falling edge in
event counter mode
Start from “L” output in
pulse output mode
Measure “L” pulse
width in pulse width
measurement mode
Rising edge active for
CNTR0 interrupt
4
5
0
Timer X operating
mode bits
b5 b4
0 0 : Timer mode
0 1 : Pulse output mode
1 0 : Event counter mode
1 1 : Pulse width
measurement mode
Notes 1: Setting the CNTR0 active edge switch bit affects 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.
2: Pulse output mode
Set “1” to bit 4 (CNTR0 pin) of the port P5 direction register (output mode).
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
Set “0” to bit 4 (CNTR0 pin) of the port P5 direction register (input mode).
4: Pulse width measurement mode
Set “0” to bit 4 (CNTR0 pin) of the port P5 direction register (input mode).
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
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.
Do not switch the pins which is used as the real time port to the input mode during
operation.