450
Chapter 13
16-bit Multi-Purpose Timer G (TMG)
Preliminary User’s Manual U17566EE1V2UM00
13.6 Explanation of Basic Operation
(1)
Overview of the mode settings
The Timer Gn includes 2 channels of 16-bit counters (TMGn0/TMGn1), which
can operate as independently timebases. TMGn0 (TMGn1) can be set by
CCSGn0 bit (CCSGn5 bit) in the following modes:
• free-run mode
• match and clear mode
When a timer output (TOGnm) or INTCCGnm interrupt is used, one of the two
counters can be selected by setting the TBGnm bit (m = 1 to 4) of the
TMGCMHn register.
The tables below indicate the interrupt output and timer output states
dependent on the register setting values.
Table 13-8
Interrupt output and timer output states dependent on the register
setting values
Note
1.
An interrupt is generated only when the value of the GCCn0 register is
FFFFH.
2.
An interrupt is generated only when the value of the GCCn0 register is not
FFFFH.
3.
The setting of the CCSGnm bit in combination with the SWFGnm bit sets
the mode for the timing of the actualization of new compare values.
•
In compare mode the new compare value will be immediately active.
•
In PWM mode the new compare value will be active first after the next
overflow or match & clear of the assigned counter (TMGn0, TMGn1).
Register setting value
State of each output pin
CCSGn0
TBGnm
SWFGnm
CCSGnm
INTTMGn0
INTCCGn0
INTCCGnm
TOGnm
0
Free-run
mode
0
0
0
Overflow
interrupt
TI0 edge
detection
TIm edge
detection
Tied to inactive
level
1
GCCnm match
1
0
TIm edge
detection
1
CMPGm match
PWM
(free run)
1
Match and
clear
mode
0
0
Overflow
interrupt
Note 1
GCCn0
match
Note 2
TIm edge
detection
Tied to inactive
level
1
GCCnm match
1
0
TIm edge
detection
1
CMPGm match
PWM
(match and clear)
electronic components distributor