27.4.3.1 Initialization

Since the module can be used for Input Capture/Output Compare/PWM, selecting the correct operation required should be the first task. The best practice is to clear all the associated control registers.

When the CCP module is reset or disabled (CCPON = 0):
  • The ICOV and ICBNE status flags are cleared
  • CCPxBUFH/L and their FIFO buffer are cleared
  • CCPxTMRH/L are reset to zero
  • The capture prescaler counter is reset to zero
  • The capture event counter for interrupt generation is reset to zero