
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
Capture/Compare Units
User’s Manual
17-21
V2.2, 2004-01
CC12_X1, V2.1
wrote to the register, a match would have been detected and the reprogramming would
go into effect during the next timer period.
show special cases for compare modes 2 and 3. Case 1
illustrates the effect when the compare value is equal to the reload value of the timer. An
interrupt is generated in both modes. In mode 3, the output signal is not affected - it
remains at the high level. Setting the compare value equal to the reload value easily
enables a 100% duty cycle signal for PWM generation. The important advantage here is
that the compare interrupt is still generated and can be used to reload the next compare
value. Thus, no special treatment is required for this case (see Case 3).
Cases 2, 4, and 5 show different options for the generation of a 0% duty cycle signal.
Case 2 shows an asynchronous reprogramming of the compare value equal to the
reload value. At the end of the current timer period, a compare interrupt will be
generated, which enables software to set the next compare value. The disadvantage of
this method is that at least two timer periods will pass until a new regular compare value
can go into effect. The compare match with the reload value FFF9
H
will block further
compare matches during that timer period. This is additionally illustrated by Case 4.
Figure 17-9
Special Cases in Compare Modes 2 and 3
MCT05425
CC0 = FFF9
Int.
Int.
CCxIO
Case 1
Int.
CCxIO
Case 2
Int.
CC0 = FFF9
Int.
CCxIO
Case 3
Int.
CC0 = FFFB
CCxIO
Case 4
Int.
CC0 = FFF9
Int.
CC0 =
FFFC
No
Comp.
CCxIO
Case 5
Int.
CC0 =
FFFC
Int.
CC0 = FFF8
FFFC
FFFD
FFFE
FFFF
FFF9
FFFA
FFFB
FFFC
FFFD
FFFE
FFFF
FFF9
FFFA
FFFB
Timer Contents
Reload Value = FFF9
CC0 = FFF9
Int.