Ok, that puts a little different light on it. I'd suggest you google MegaSquirt. It's an open source EFI engine controller that has gone through a lot of improvement over the years. Even if you have no intention of using it, it'll point out a lot of details of how to do these things. -Denny On Wed, Nov 21, 2012 at 4:32 PM, nik . wrote: > Hi Denny, I want to multiply the rpm with map values (continuously update= d > too) to derive injector pw. All this is much later. I'm starting with rpm > ideas and writing some basic code for that. > > Rev range 7000rpm with 250rpm or 500rpm res. > On Nov 22, 2012 11:18 AM, "Denny Esterline" wrote: > > > On Wed, Nov 21, 2012 at 3:49 PM, Spehro Pefhany > > wrote: > > > > > At 04:56 PM 21/11/2012, you wrote: > > > >A 4 stroke/4 cyl engine has 2 ignition pulses per 1 crankshaft > > revolution. > > > >If this is so then whats the technique behind counting RPM with a > PIC. I > > > >need some ideas only. Please don't discuss HW or other. > > > > > > > >I've gone as far as thinking the RPM will have to be fed to a CCP pi= n > as > > > >input. I understand how the CCP will be setup but can't quite get th= e > > idea > > > >of how exactly to count RPM and say if that's sorted out, display it > > (this > > > >part is not a concern right now). > > > > > > > >Any ideas would be great. > > > > > > > Other's have already given you good answers, but there's another piece = to > > the puzzle - what are you doing with the data? In other words, how > accurate > > does it need to be, over what operating speed range and how frequently = do > > you need new data? > > > > The time between pulses method works very well on the low end, but > > the resolution isn't as good at high speed. But at some (very low) spee= d, > > the timer > > will roll-over before the next pulse arrives. You have to handle that > > differently. > > It's also very quick to provide new data, you get new information twice > per > > revolution. > > > > The pulses over time method has better resolution on the high end. The > > trade offs > > include slower update rate, simpler math, among other details. > > > > Modern automotive designs use time between pulses - but they use the da= ta > > to > > do some rather interesting tasks (detecting single cylinder misfires) s= o > > they > > need new RPM data many times per revolution (several hundred times per > > second). > > Displaying this for a TACH for a human to read would be nutty, even a > > couple > > times per second is faster than most people can see/react to. > > > > So, what are you doing with the data? > > > > -Denny > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .