English
Language : 

M16C62_M Datasheet, PDF (338/615 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/60 SERIES
Timer A
Mitsubishi microcomputers
M16C / 62A Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Selecting event counter mode and functions
b7
b0 Timer Ai mode register (i=0 to 4) [Address 039616 to 039A16]
1 0 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 (TAiOUT 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
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)
Setting up/down flag
b7
000
b0 Up/down flag [Address 038416]
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 2-phase pulse signal processing function, be sure to set the select bit to “0”.
Setting one-shot start flag and trigger select register
b7
b0
b7
One-shot start flag [Address 038216]
ONSF
Timer A0 event/trigger select bit
b7 b6
0 0 : Input on TA0IN is selected (Note)
Note: Set the corresponding port direction register to “0”.
b0 Trigger select register [Address 038316]
TRGSR
Timer A1 event/trigger select bit
b1 b0
0 0 : Input on TA1IN is selected (Note)
Timer A2 event/trigger select bit
b3 b2
0 0 : Input on TA2IN is selected (Note)
Timer A3 event/trigger select bit
b5 b4
0 0 : Input on TA3IN is selected (Note)
Timer A4 event/trigger select bit
b7 b6
0 0 : Input on TA4IN is selected (Note)
Setting counter value
(b15)
b7
(b8)
b0 b7
Timer A0 register [Address 038716, 038616] TA0
b0 Timer A1 register [Address 038916, 038816] TA1
Timer A2 register [Address 038B16, 038A16] TA2
Timer A3 register [Address 038D16, 038C16] TA3
Timer A4 register [Address 038F16, 038E16] TA4
Can be set to 000016 to FFFF16
Setting count start flag
b7
b0
Count start flag [Address 038016]
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
Start count
Figure 2.2.15. Set-up procedure of event counter mode, free run type selected
2-21