22.2.4 CCP Prescaler

There are four prescaler settings specified by the MODE bits. Whenever the CCP module is turned off, or the CCP module is not in Capture mode, the prescaler counter is cleared. Any Reset will clear the prescaler counter.

Switching from one capture prescaler to another does not clear the prescaler and may generate a false interrupt. To avoid this unexpected operation, turn the module off by clearing the CCPxCON register before changing the prescaler. The example below demonstrates the code to perform this function.

Changing Between Capture Prescalers

BANKSEL CCP1CON
CLRF    CCP1CON        ;Turn CCP module off
MOVLW   NEW_CAPT_PS    ;CCP ON and Prescaler select → W
MOVWF   CCP1CON        ;Load CCP1CON with this value