> Yes, that can be a problem, but I see my jitter also when I have a > function generator at a constant frequency connected to the circuit. > And this is with a nice clean square wave into the INT input? I was going to suggest that noise may be a problem. > > Unfortunately you need 16 bits because of the dynamic range of the > > counter. Unless you use a large counter, it will either overflow at > > low RPM or run out of resolution at higher RPM. What I did was to > > convert to RPM, and feed the results into a simple (digital) low pass > > filter. I could get a reading steady to within a few RPM on a 4 > > cylinder engine this way. You could lose either one or two significant > > figures depending on your requirements. A least significant digit > > which constantly changes is very irritating, I'd rather not see it :o) > > I also have an IIR low-pass filter that works ok. > > The thing I'm building is a shift-light device, but not a > conventional one. It's supposed to be predictive, so that it will > give a forewarning that is time dependant, ie it gives you a warning > at a preset time before max RPM is reached. Conventional shift-lights > is based on RPM, and will warn based on current RPM-reading. > > This involves a bit of math, but I got that part figured out. The > problem is that my counter jitters too much, and I can't figure out > why. > So you work out the slope of the current (delta RPM)/Time and then extrapolate the RPM in x seconds? That's pretty cunning. > I could use polling as you did, but I'm not sure why that should be > better. > I'm wondering if you have a potential problem with interrupt priorities. Posting your ISR code would be helpfull. What level of jitter are you seeing? Is it always the same or does it vary with the input frequency (RPM)? Cheers Mike