Another project, this time I'm making a "drive monitor" thing for my car, which includes one of those fancy MPG meters among other things. I've got the math worked out on how I'm going to read the info to get the stuff I need to calculate and output the desired information. My thing is that I'm having difficulty trying to figure out the best way to read frequency, pulse width, etc. from the ECM with my Arduno. All the signal waveforms are square waves, although not all are 5V. Some not only vary in frequency, but duty cycle/pulse width. I've also got a small Cyclone II FPGA I can use as well if need be to help handle the logic/counting. Most, if not all, of these signals are extremely low frequency, Some even single digit Hz depending on conditions. I haven't seen much go more than a couple KHz, if that.
I've already looked through libraries that already exist for Arduino, but none are suitable for something that's not a 50% duty cycle or something that varies so wildly in frequency/cycle. The ECM can do something with that, obviously, so I just need a hand figuring out how to make it a bit more user- and controller-friendly. Ideas using the Arduino and the FPGA are both welcome. Wouldn't mind the experience in Verilog or VHDL either, but I think this stuff is just too slow to be of any practical use on that... although I could and may be completely wrong.
Thanks!