Renesas M16C Series User Manual page 30

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30245 Group
www.DataSheet4U.com
Figure 2.2.15. Set-up procedure of event counter mode, free run type selected
Rev.2.00 Oct 16, 2006
REJ09B0340-0200
Selecting event counter mode and functions
b7
b0
Timer Ai mode register (i=0 to 4) [Address 0396
0
1
0
0
0
0
1
TAiMR (i=0 to 4)
Selection of event counter mode
Pulse output function select bit
0 : Pulse is not output (TAi OUT pin is a normal port pin)
Count polarity select bit
0 : Counts external signal's falling edge
Up/down switching cause select bit
0 : Up/down flag's content
0 (Must always be "0" in event counter mode)
Count operation type select bit (Note 1)
1 : Free-run type
Invalid in event counter mode (i = 0, 1)
Invalid when not using two-phase pulse signal processing(i = 2 to 4)
Note 1: First set to "Reload type" operation. Once the first counting pulse has occurred, the timer may be changed to "Free-Run type".
Setting up/down flag
b7
b0
Up/down flag [Address 0384
0
0
0
UDF
Timer A0 up/down flag
0 : Down count
Timer A1 up/down flag
0 : Down count
Timer A2 up/down flag
0 : Down count
Timer A3 up/down flag
0 : Down count
Timer A4 up/down flag
0 : Down count
When not using the two-phase pulse signal processing function, set the select bit to "0".
Setting one-shot start flag and trigger select register
b7
b0
One-shot start flag [Address 0382
ONSF
Timer A0 event/trigger select bit
b7 b6
0 0 :
Input on TA0
Note 2: Set the corresponding port direction register to "0".
Setting divide ratio
(b15)
(b8)
b7
b0
b7
Can be set to 0000
Setting count start flag
b7
b0
Count start flag [Address 0380
TABSR
Timer A0 count start flag
Timer A1 count start flag
Timer A2 count start flag
Timer A3 count start flag
Timer A4 count start flag
page 21 of 354
to 039A
16
]
16
b7
]
16
is selected (Note 2)
IN
Timer A0 register [Address 0387
Timer A1 register [Address 0389
Timer A2 register [Address 038B
b0
Timer A3 register [Address 038D
Timer A4 register [Address 038F
to FFFF
16
16
]
16
Start count
]
16
b0
Trigger select register [Address 0383
TRGSR
Timer A1 event/trigger select bit
b1 b0
0 0 :
Input on TA1
is selected (Note 2)
IN
Timer A2 event/trigger select bit
b3 b2
0 0 :
Input on TA2
is selected (Note 2)
IN
Timer A3 event/trigger select bit
b5 b4
0 0 :
Input on TA3
is selected (Note 2)
IN
Timer A4 event/trigger select bit
b7 b6
0 0 :
Input on TA4
is selected (Note 2)
IN
, 0386
] TA0
16
16
, 0388
] TA1
16
16
, 038A
] TA2
16
16
, 038C
] TA3
16
16
, 038E
] TA4
16
16
2. Timer A
]
16

Advertisement

Table of Contents
loading

Table of Contents