
The capture / compare units
UM0404
DocID13284 Rev 2
Figure 140. Compare mode 2 and 3 block diagram
Note:
The port latch and pin remain unaffected in compare mode 2.
Figure 141. Timing example for compare modes 2 and 3
16.5.4 Compare
mode
3
Compare mode 3 is selected for register CCx by setting bit-field CCMODx of the
corresponding mode control register to ‘111b’. In compare mode 3 only one compare event
will be generated per timer period.
When the first match within the timer period is detected the interrupt request flag CCxIR is
set to ‘1’ and also the output pin CCxIO (alternate port function) will be set to ‘1’. The pin will
be reset to ‘0’, when the allocated timer overflows.
If a match was found for register CCx in this mode, all further compare events during the
current timer period are disabled for CCx until the corresponding timer overflows. If, after a
Capture Register CCx
CAPCOM Timer Ty
TyIR
Interrupt
Request
Input
Clock
x = 31...0
y = 0, 1, 7, 8
CCxIR
Comparator
CCMODx
Port Latch
(Mode 3)
CCxIO
Interrupt
Request
Set
Reset
*) Output pin CCxIO only effected in mode 3. No changes in mode 2.
x = 31...0
y = 0, 1, 7, 8
TyIR
CCxIR
TyIR
CCxIR
TyIR
Interrupt
Requests:
Contents of Ty
FFFFh
Compare Value cv2
Compare Value cv1
Reload Value <TyREL>
0000h
Event #1
CCx: = cv2
Event #2
CCx: = cv1
State of
CCxIO:
t
1
0