My thinking would be different. I think I'd time an individual pulse and calculate the speed. There was a huge thread a couple weeks back about monitoring the speed on a dozen shafts, much of that would be applicable here. Also I think you'll find the signal much more robust than you think (read- you don't need to filter for jitter and you can draw some signal) Personally, for interfacing, I would use a resistor in series with the pic input (maybe 10K) and a zener clamp to ground. If you're really brave, omit the zener clamp and let the PICs input protection diodes do the work, though I wouldn't recommend it :-). Automotive sensors are generally low impedance, this gives them better noise immunity in a hostile environment. -Denny Esterline ----- Original Message ----- From: "Hulatt, Jon" To: Sent: Tuesday, September 23, 2003 8:30 AM Subject: [EE] (automotive) frequency trigger > Hi all, > > For my next project, I want to initiate some action when my car exceeds > approximately 10mph. The "speedo" sensor is some kind of proximity switch on > the output end of the gearbox/diff. So, the output it a 12v ish square wave, > of frequency proportional to speed. My multimeter measures the frequency at > about 20 Hz at 10mph. > > So, to measure this frequency, my idea is to use the CCP, in capture mode, > with an appropriately prescaled timer. My Capture ISR will increment a > counter each time the CCP event fires, if the timer represents a (period) > shorter than 40ms (ie, faster), and, when the counter gets to an appropriate > number, perhaps 20 ish, I'll inititiate the other code. Idea of using the > counter is to filter out any bounces or other muck in the line. > > Leading to my first question- does this plan seem like a workable idea? I've > not much experience with a) pic and b) the automotive envorinment. > > Secondly, is the question of how to interface the 12v square signal with the > pic? I'd thought of using an optoisolator, but is there a better, or simpler > way of protecting the pic from a) getting 12v not 5v and b) any dirty spike > type things? I think I need a relatvely high impedance, because the signal > goes into the ECU, so if I steal too much of it, I may make the car rather > ill. > > Appreciate your thoughts. > > Jon > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu