27.4.4.1.4 Special Cases of Single Compare Mode
In Single Edge Compare modes, there are several special cases to consider:
- When the value of CCPxRA is greater than the timer period, the compare value will always be greater than the timer value. No compare event will ever occur, and the compare output will remain at the initial condition.
- When the value of CCPxRA equals the timer period, the compare interval is the same as the timer period. Combined with Toggle mode, this can be used to generate a fixed frequency square wave (Figure 27-13).
- When CCPxRA = 0000h, the timer is held in Reset, either by an asserted trigger
source or when CCPTRIG =
0
is the triggered operation. The compare output will remain at the initial condition. The compare output will change once the selected trigger source is deasserted, allowing the timer to operate. - If CCPxRA is cleared after a compare event, the SYNC[4:0] signal is asserted and the compare output will remain at its previous state.
- If, after a compare event, the
CCPxRA register is modified to a value greater than the current timer value but
less than the timer period, a second compare event will be generated within the
count period. The SCEVT bit must also be cleared when MOD[3:0] is
‘
0001
’ or ‘0010
’ to reset the output pin for the next compare event.
Note: For all special cases, ‘timer period’ can be defined as either a
CCPxPR match or an event by the selected SYNC[4:0] source.