English
Language : 

M38203M4 Datasheet, PDF (156/344 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.3 Timer X and timer Y
sReal time port function
Figure 2.3.27 shows an example of setting registers for using the real time port (referred as RTP)
function.
[Notes on use]
Notes 1: After reset release, port P6 direction register is set for the input mode, so pins P60/INT3/RTP0
and P61/RTP1 operate as ordinary input ports. For using as RTP, be sure to set the
corresponding bits of the port P6 direction register for the output mode.
2: Change RTP output data as required, for example, by using an interrupt.
3: Do not change ports P60 and P61 selected as RTP into input pins during RTP operation.
ŒPort P6 direction register
b7
b0
P6D : Port P6 direction register [Address 0D16]
b0, b1 : Bits corresponding to ports P60 (RTP0) and P61 (RTP1)
0 : Input mode
1 : Output mode
: Nothing is allocated
Setting of timer X mode register
Select RTP or others
b7
b0
1
1 TXM : Timer X mode register [Address 2716]
b0 : Timer X write control bit
0 : Write value in latch and counter
1 : Write value in latch only
b1 : Real time port control bit
1 : Real time port function valid
b2 : P60 data for real time port
b3 : P61 data for real time port
b5, b4 : Timer X operating mode bits
0 0 : Timer mode
0 1 : Pulse output mode
1 0 : Event counter mode
1 1 : Pulse width measurement mode
b6 : CNTR0 active edge switch bit
•CNTR0 interrupt
0 : Falling edge active
1 : Rising edge active
•Pulse output mode
0 : Start at initial level “H” output
0 : Start at initial level “L” output
•Event counter mode
0 : Rising edge active
1 : Falling edge active
•Pulse width measurement mode
0 : Measure “H” level width
1 : Measure “L” level width
b7 : Timer X stop control bit
1 : Count stop
ŽSet count value (low-order) to timer X (low-order) (TXL) [Address 2016]
Set count value (high-order) to timer X (high-order) (TXH) [Address 2116]
Set timer X stop control bit of timer X mode register to “0” to start counting
Fig. 2.3.27 Example of setting registers for using RTP
2–70
3820 GROUP USER’S MANUAL