English
Language : 

PIC18F45K80-I Datasheet, PDF (258/622 Pages) Microchip Technology – 28/40/44/64-Pin, Enhanced Flash Microcontrollers with ECAN and nanoWatt XLP Technology
PIC18F66K80 FAMILY
19.2.3 SOFTWARE INTERRUPT
When the Capture mode is changed, a false capture
interrupt may be generated. The user should keep the
CCPxIE bit (PIE4<x>) clear to avoid false interrupts
and should clear the flag bit, CCPxIF, following any
such change in operating mode.
19.2.4 CCP PRESCALER
There are four prescaler settings in Capture mode.
They are specified as part of the operating mode
selected by the mode select bits (CCPxM<3:0>).
Whenever the CCP module is turned off, or the CCP
module is not in Capture mode, the prescaler counter
is cleared. This means that any Reset will clear the
prescaler counter.
Switching from one capture prescaler to another may
generate an interrupt. Doing that also will not clear the
prescaler counter – meaning the first capture may be
from a non-zero prescaler.
Example 19-1 shows the recommended method for
switching between capture prescalers. This example
also clears the prescaler counter and will not generate
the “false” interrupt.
EXAMPLE 19-1: CHANGING BETWEEN
CAPTURE PRESCALERS
CLRF CCPxCON
MOVLW NEW_CAPT_PS
MOVWF CCPxCON
; Turn CCP module off
; Load WREG with the
; new prescaler mode
; value and CCP ON
; Load CCPxCON with
; this value
19.2.5
CAN MESSAGE TIME-STAMP
(CCP2 ONLY)
For CCP2, only the CAN capture event occurs when a
message is received in any of the receive buffers.
When configured, the CAN module provides the trigger
to the CCP2 module to cause a capture event. This
feature is provided to “time-stamp” the received CAN
messages.
This feature is enabled by setting the CANCAP bit of
the CAN I/O Control register (CIOCON<4>). The mes-
sage receive signal from the CAN module then takes
the place of the events on RC2/CCP2.
If this feature is selected, then four different capture
options for CCP2M<3:0> are available:
• 0100 – Every time a CAN message is received
• 0101 – Every time a CAN message is received
• 0110 – Every 4th time a CAN message is
received
• 0111 – Capture mode, every 16th time a CAN
message is received
DS39977F-page 258
 2010-2012 Microchip Technology Inc.