464
Chapter 13
16-bit Multi-Purpose Timer G (TMG)
Preliminary User’s Manual U17566EE1V2UM00
(2)
Compare operation (match and clear)
Basic settings (m = 1 to 4):
(a) Example: Interval timer (match and clear)
Setting Method
(1)
An usable compare register is one of GCCn1 to GCCn4, and the
corresponding counter must be selected with the TBGnm bit.
(2)
Select a count clock cycle with the CSE12 to CSE10 bits (TMGn1) or
CSE02 to CSE00 bits (TMGn0).
(3)
Set an upper limit on the value of the counter in GCCn0 or GCCn5.
(4)
Write data to GCCnm.
(5)
Start timer operation by setting the POWERn bit and TMGxE bit (x = 0, 1).
Operation:
(1)
When the value of the counter matches the value of GCCnm, a match
interrupt (INTCCGnm) is output.
(2)
When the value of GCCn0 or GCCn5 matches the value of the counter,
INTCCGn0 (or INTCCGn5) is output, and the counter is cleared. This
operation is referred to as "match and clear".
(3)
The counter resumes count-up operation starting with 0000H.
Bit
Value
Remark
CCSGn0
1
match and clear mode
CCSGn5
1
SWFGnm
0
disable TOGnm
CCSGnm
1
Compare mode for
GCCnm
TBGnm
X
assign counter
for GCCnm
0: TMGn0
1: TMGn1
electronic components distributor