27.4.3 Input Capture Mode
When CCSEL = 1
, the module is configured for Input Capture mode. This
mode is used to capture a timer value from an independent timer base on the occurrence
of an event on an input pin. This mode is useful in applications requiring frequency
(time period) and pulse measurement.
Input Capture mode uses the CCPxTMR registers as a dedicated 16/32-bit synchronous, up counting timer used for event capture. This value is written to the FIFO buffer when a capture event occurs. The internal value may also be read with a synchronization delay from the CCPxTMR register.
Input Capture mode is the only major mode available when CCSEL is set. The T32 and the MOD[3:0] bits determine the various Capture modes, as shown in Table 27-14.
Figure 27-5 provides a simplified block diagram of the Input Capture mode.
T32 (CCPxCON1[15]) | MOD[3:0] (CCPxCON1[3:0]) | Operating Mode |
---|---|---|
0 | 0000 | Edge Detect (16-bit capture) |
1 | 0000 | Edge Detect (32-bit capture) |
0 | 0001 | Every Rising (16-bit capture) |
1 | 0001 | Every Rising (32-bit capture) |
0 | 0010 | Every Falling (16-bit capture) |
1 | 0010 | Every Falling (32-bit capture) |
0 | 0011 | Every Rise/Fall (16-bit capture) |
1 | 0011 | Every Rise/Fall (32-bit capture) |
0 | 0100 | Every 4th Rising (16-bit capture) |
1 | 0100 | Every 4th Rising (32-bit capture) |
0 | 0101 | Every 16th Rising (16-bit capture) |
1 | 0101 | Every 16th Rising (32-bit capture) |