22 CCP - Capture/Compare/PWM Module
The Capture/Compare/PWM module is a peripheral that allows the user to time and control different events, and to generate Pulse-Width Modulation (PWM) signals. In Capture mode, the peripheral allows the timing of the duration of an event. The Compare mode allows the user to trigger an external event when a predetermined amount of time has expired. The PWM mode can generate Pulse-Width Modulated signals of varying frequency and duty cycle.
The Capture and Compare functions are identical for all CCP modules.
Important: In devices with more
than one CCP module, it is very important to pay close attention to the register names
used. Throughout this section, the prefix ‘CCPx’ is used as a generic replacement for
specific numbering. A number placed where the ‘x’ is in the prefix is used to distinguish
between separate modules. For example, CCP1CON and CCP2CON control the same operational
aspects of two completely different CCP modules.