bigbadbob76 wrote:hmmmm.... not easy. I'm no programmer but I think you have to do it with interupts.
Yes, it would be nice for the main code loop to do all the maths and the display updates, and for the device to wait for an interrupt to signal that a pulse has started, instead of having to watch the analogue input the whole time. But as far as I can tell, interrupts only work on the digital input pins.
But I think an alternative could be to have a routine that runs for an undisturbed (I was going to say 'uninterrupted') period, say 100ms, to sample the analogue input pin, then returns to the main code with an RPM value. This could then be used to update the display, and when that and any other loop activities are complete the RPM routine would be called again. 100ms would give me plenty of time get an accurate RPM value, and even if it only updated once per second due to slow LCD updates, that would probably be enough to make a reasonable tacho display. Something to work on.
Thank you. What kind of resistor is needed to deal with that?bigbadbob76 wrote:Here's the scope plots anyway-
5v/division, x10 probe, so 375V pk-pk.
no wonder it tingles.![]()