English
Language : 

PIC16LF18854 Datasheet, PDF (447/668 Pages) Microchip Technology – C Compiler Optimized RISC Architecture
PIC16(L)F18856/76
30.1 Capture Mode
The Capture mode function described in this section is
available and identical for all CCP modules.
Capture mode makes use of the 16-bit Timer1
resource. When an event occurs on the capture
source, the 16-bit CCPRxH:CCPRxL register pair
captures and stores the 16-bit value of the
TMR1H:TMR1L register pair, respectively. An event is
defined as one of the following and is configured by the
CCPxMODE<3:0> bits of the CCPxCON register:
• Every falling edge
• Every rising edge
• Every 4th rising edge
• Every 16th rising edge
When a capture is made, the Interrupt Request Flag bit
CCPxIF of the PIR6 register is set. The interrupt flag
must be cleared in software. If another capture occurs
before the value in the CCPRxH, CCPRxL register pair
is read, the old captured value is overwritten by the new
captured value.
Figure 30-1 shows a simplified diagram of the capture
operation.
30.1.1 CAPTURE SOURCES
In Capture mode, the CCPx pin should be configured
as an input by setting the associated TRIS control bit.
Note:
If the CCPx pin is configured as an output,
a write to the port can cause a capture
condition.
The capture source is selected by configuring the
CCPxCTS<2:0> bits of the CCPxCAP register. The
following sources can be selected:
• CCPxPPS input
• C1OUT_sync
• C2OUT_sync
• IOC_interrupt
• LC1_out
• LC2_out
• LC3_out
• LC4_out
FIGURE 30-1:
CAPTURE MODE OPERATION BLOCK DIAGRAM
CTS<2:0>
LC4_out
111
LC3_out
110
LC2_out
101
LC1_out
100
IOC_interrupt
011
C2OUT_sync
010
C1OUT_sync
001
CCPx
PPS
000
Prescaler
1,4,16
and
Edge Detect
set CCPxIF
MODE <3:0>
RxyPPS
Rev. 10-000158F
9/1/2015
CCPx
TRIS Control
CCPRxH CCPRxL
16
16
TMR1H TMR1L
CCPxPPS
 2016 Microchip Technology Inc.
Preliminary
DS40001824A-page 447