22.4 Input Capture Mode

Input Capture mode is used to capture a timer value from an independent timer base, upon an event, on an input pin or other internal trigger source. The input capture features are useful in applications requiring frequency (time period) and pulse measurement. Figure 22-4 depicts a simplified block diagram of Input Capture mode.

Input Capture mode uses a dedicated 16/32-bit, synchronous, up counting timer for the capture function. The timer value is written to the FIFO when a capture event occurs. The internal value may be read (with a synchronization delay) using the CCPxTMRH/L registers.

To use Input Capture mode, the CCSEL bit (CCPxCON1L[4]) must be set. The T32 and the MOD[3:0] bits are used to select the proper Capture mode, as shown in Table 22-3.

Table 22-3. Input Capture x Modes
MOD[3:0] (CCPxCON1L[3:0])T32 (CCPxCON1L[5])Operating Mode
00000Edge Detect (16-bit capture)
00001Edge Detect (32-bit capture)
00010Every Rising (16-bit capture)
00011Every Rising (32-bit capture)
00100Every Falling (16-bit capture)
00101Every Falling (32-bit capture)
00110Every Rising/Falling (16-bit capture)
00111Every Rising/Falling (32-bit capture)
01000Every 4th Rising (16-bit capture)
01001Every 4th Rising (32-bit capture)
01010Every 16th Rising (16-bit capture)
01011Every 16th Rising (32-bit capture)
Figure 22-4. Input Capture x Block Diagram