335
Chapter 10
Timer
Preliminary User’s Manual U15839EE1V0UM00
10.3.8 Match and clear mode
The match and clear mode is mainly used reduce the number of valid bits of the counters (TMGn0,
TMGn1).
Therefore the fixed assigned register GCCn0 (GCCn1) is used to compare its value with the counter
TMGn0 (TMGn1). If the values match, than an interrupt is generated and the counter is cleared. Than
the counter starts up counting again.
(1)
Capture operation (match ad clear)
Basic settings (m = 1 to 4):
(a) Example: Pulse width measurement or period measurement of the TIGm input signal
Setting method:
(1)
When using one of TOGn1 to TOGn4-pin, select the corresponding counter with the TBGm bit.
When CCSG0n = 1, TI0 cannot be used. When CCSG5n = 1, TIGn5 cannot be used.
(2)
Select a count clock cycle with the CSE12 to CSE10 (TMGn1) bits or CSE02 to CSE00 (TMGn0)
bits.
(3)
Select a valid TIGm edge with the IEGm1 and IEGm0 bit. A rising edge, falling edge, or both
edges can be selected.
(4)
Set an upper limit on the value of the counter in GCCn0 or GCCn5.
(5)
Start timer operation by setting POWER bit and TMG0E bit (or TMG1E bit).
Operation:
(1)
When a specified edge is detected, the value of the counter is stored in GCCnm, and an edge
detection interrupt (INTCCGnm) is output.
(2)
When the value of GCCn0 or GCCn5 matches the value of the counter, INTCCGn0 (INTCCGn5) is
output, and the counter is cleared. This operation is referred to as "match and clear".
(3)
If a match and clear event has occurred between capture operations, the CCFGy flag is set when
GCCny is read. Correct capture data by checking the value of CCFGy.
Bit
Value
Remark
CCSG0n
1
match and
clear mode
CCSG5n
1
SWFGm
0
disable TOGnm
CCSGm
0
Capture mode
for GCCnm
TBGm
X
assign counter
for GCCnm
0: TMGn0
1: TMGn1
Summary of Contents for mPD703128
Page 6: ...6 Preliminary User s Manual U15839EE1V0UM00 ...
Page 20: ...20 Preliminary User s Manual U15839EE1V0UM00 ...
Page 32: ...32 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 154: ...154 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 238: ...238 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 356: ...356 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 522: ...522 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 600: ...600 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 610: ...610 Preliminary User s Manual U15839EE1V0UM00 ...
Page 612: ......