PIC and pulse trains

Hello,

I have been playing with a 16F877 in the past.

Is it possible to use a 16F877 or any other PIC, to check for a pulse every half us ?

Is that asking too much from a PIC ?

Reply to
Andrew Rich
Loading thread data ...

Maybe. Depends on what you want to do. You can detect a 500ns pulse with an interrupt, but a 100ns instruction cycle PIC will only give you a couple of instructions to do anything useful before the next pulse comes along. If you want to count the pulse with one of the timers then that should be OK.

Dave :)

Reply to
David L. Jones

The answer to both your questions is that it depends on the length of your pulse(1 second? 10ms? 10uS? 1ns?), how clean (noise? voltage levels? ringing?) it is, & the method you use to detect it. For example; if your pulse is from a push button, with a minimum of 10ms, connecting it straight to an I/O pin on your PIC via a resistor & debouncing it in software would probably be very reliable. If you're trying to count sync signals from a composite video signal, it'll be a lot harder.

The Microchip website has a ton of really good information on this topic (complete with circuits & sample code) in the design guides & application notes sections.

--
   W          
 . | ,. w ,   "Some people are alive only because
  \|/  \|/     it is illegal to kill them."    Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Lionel

He already said it's a pulse every 500ns, so the pulse width has to be under 500ns I would think ;-)

If he wants to count the pulses the PIC can do that, but if he wants to detect the pulse and then do some processing the PIC won't be able to do that.

Dave :)

Reply to
David L. Jones

Good old English, eh?

Does he want to check every 500nS to see if a pulse of some length is present or does he want to check for a pulse which repeats every

500nS?

Depends on how you read the original question.

Alan

-- Sell your surplus electronic components at

formatting link
Search or browse for that IC, capacitor, crystal or other component you need.

Reply to
Alan

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.