Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why we use Capture CCP of PIC microprossesor

Not open for further replies.

YIM bunchhat

Member level 2
Oct 19, 2010
Reaction score
Trophy points
Activity points
I want to know why we use CCP pin of PIC as capture?

The Input Capture Mode of a PIC is useful to measure the exact time when an input signal changes. When the input signal changes the CCP hardware in the PIC latches the current value of a free-running timer in some latches that the program can read later. If you didn't have Input Capture and you wanted to time some input then you would have to let the input cause an interrupt. Then in the interrupt service routine the program would read the timer. The trouble is the interrupt does not always occur right away because sometimes interrupts are disabled for a time. So when you read the timer, some time may go by and the value you read may be a little late, and so not as accurate as it could be. But with the CCP hardware in the PIC the timer is latched immediately so when the program gets around to reading that latch the value in that latch will be as accurate as it can be, even if the program was a little delayed in doing the reading.
Thank you Tunelabguy, I ask about Captuer CCP of PIC because I want to make frequency mesurement tool. Can you show me any code about how to make Captuer CCP work?

How you measure frequency depends on the frequency range involved, response time, and accuracy. Very different techniques would be used, depending on these things.

Not open for further replies.

Part and Inventory Search

Welcome to