
DocID13284 Rev 2
339/564
UM0404
The capture / compare units
On channels 24...27 compare mode 1 will generate interrupt requests but no output function
is provided.
Figure 139. Timing example for compare modes 0 and 1
16.5.3 Compare
mode
2
Compare mode 2 is an interrupt-only mode similar to compare mode 0, but only one
interrupt request per timer period will be generated. Compare mode 2 is selected for register
CCx by setting bit-field CCMODx of the corresponding mode control register to ‘110b’.
When a match is detected in compare mode 2 for the first time within a timer period, the
interrupt request flag CCxIR is set to ‘1’. The corresponding Port2 pin is not affected and
can be used for general purpose I/O. However, after the first match has been detected in
this mode, all further compare events within the same timer period are disabled for compare
register CCx until the allocated timer overflows. This means, that after the first match, even
when the compare register is reloaded with a value higher than the current timer value, no
compare event will occur until the next timer period.
In
, the compare value in register CCx is modified from cv1 to cv2 after compare
event #1. Compare event #2, however, will not occur until the next period of timer Ty.
*) Output pin CCxIO only effected in mode 1. No changes in mode 0.
x = 31...0
y = 0, 1, 7, 8
TyIR
CCxIR
CCxIR
TyIR
CCxIR
CCxIR
TyIR
Interrupt
Requests:
t
Contents of Ty
FFFFh
Compare Value cv2
Compare Value cv1
Reload Value <TyREL>
0000h
Event #1
CCx: = cv2
Event #2
CCx: = cv1
Event #3
CCx: = cv2
Event #4
CCx: = cv1