456
Chapter 13
16-bit Multi-Purpose Timer G (TMG)
Preliminary User’s Manual U17566EE1V2UM00
(2)
Compare operation (free run)
Basic settings (m = 1 to 4):
(a) Example: Interval timer (free run)
Setting method interval timer:
(1)
An usable compare register is one of GCCn1 to GCCn4, and the
corresponding counter (TMGn0 or TMGn1) must be selected with the
TBGnm bit.
(2)
Select a count clock cycle with the CSE12 to CSE10 bits (TMGn1
register) or CSE02 to CSE00 bits (TMGn0 register).
(3)
Write data to GCCnm.
(4)
Start timer operation by setting POWERn and TMGn0E (or TMGn1E).
Compare Operation:
(1)
When the value of the counter matches the value of GCCnm (m = 0 to 4),
a match interrupt (INTCCGnm) is output.
(2)
When the counter overflows, an overflow interrupt (INTTMGn0/
INTTMGn1) is generated.
Figure 13-6
Timing of compare mode (free run)
Data N is set in GCCn1, and the counter TMGn0 is selected.
Bit
Value
Remark
CCSGn0
0
free run mode
CCSGn5
0
SWFGnm
0
disable TOGnm
CCSGnm
1
Compare mode for
GCCnm
TBGnm
X
assign counter
for GCCnm
0: TMGn0
1: TMGn1
N
ENFG0
TM G n0
GCCn1
INTTGnCC1
INTTGnOV0
FFFFH
FFFFH
FFFFH
Ma tch
electronic components distributor