English
Language : 

3822_03 Datasheet, PDF (133/328 Pages) Renesas Technology Corp – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.3 Timer X and timer Y
sEvent counter output mode
Figure 2.3.24 shows an example of setting registers for using the event counter mode.
[Notes on use]
Notes 1: For using interrupt processing, set the following :
•Before setting Œ below, clear the interrupt enable bits (timer X or CNTR0) and the
interrupt request bits (timer X or CNTR0) to “0.”
•After setting  below, set the interrupt enable bits (timer X or CNTR0) to “1”
(interrupts enabled) .
2: Write values in the order of the timer X (low-order) and the timer X (high-order).
ŒPort P5 direction register
b7
b0
0
P5D : Port P5 direction register [Address 0B16]
b4 : Bit corresponding to port P54
0 : Input mode
Setting of timer X mode register
Select timer mode or others
b7
1 10
b0
TXM : Timer X mode register [Address 2716]
b0 : Timer X write control bit
0 : Write value in latch and timer
1 : Write value in latch only
b1 : Real time port control bit
0 : Real time port function invalid
1 : Real time port function valid
b2 : Data storage bit for real time port (RTP0)
b3 : Data storage bit for real time port (RTP1)
b4, b5 : Timer X operating mode bits
1 0 : Event counter mode
b6 : CNTR0 active edge switch bit
0 : Rising edge active
1 : Falling edge active
b7 : Timer X operating mode bits
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.24 Example of setting registers for using event counter mode
3822 GROUP USER’S MANUAL
2–67