Trying to make sense on how to read a low frequency odometer signal.
Ahh, but it is NOT a beautiful 50% duty cycle pulsed TTL signal !!!
The signal is awful PWM signal that changes frequency a few times generated from this inductive ABS wheel sensor. What my understanding is the Pulse-Width is accurate.
What I am trying to do is to read-in the pulse-width and generate 50% duty cycle output of the same pulse-width.
The head scratcher for me is at a few Miles-Per-Hour the pulse width is in the 70% to 90% of the period, so I do not have time to generate my "50% duty cycle" before the period ends, so I guess I need to wait to the next cycle to get another reading, but at higher Miles-Per-Hour's the pulse width is 5% to 10%, and I have the space(the time) to output half-dozen 50% duty cycle pulses before the next period.
The reason for generating 50% duty-cycle output is the revised updated instrument cluster is looking for nice TTL signal with 50% duty cycle, and this revised cluster is available all day used for $50-$100, yet the identical original instrument cluster is around $1000 USD for old 20 something-year-old instrument cluster. When the value of the car is two to three times that, sad condition . I'd settle to fix the old cluster, but the traces on the PCB are all painted, so no reverse engineering here....
The revised cluster uses the 50% duty cycle signal with the same pulse-width as stated in the service literature of the car, and frequency conditions are: 5mile/hr =50Hz, 50mile/hr=500Hz, 100mile/hr=1000Hz, and the cluster goes up to 160mile per hour, but I'd be happy if it can only make it to 80miles/hr or 100miles/hr
The moral of the story is never try to get "cute" with a family member that you help them/ recommend a used car, so I'm a bit of a rock and a hard spot to figure this out as the car will not be able to get it registered for road use in the "Union of Kalifornia" in the good-old-USA....
Looking for snipits of code! Maybe someone has done a low frequency counter where the width is used for a counter! I was eyeing the PulseIn command, but it has some "flea's" for my purpose or is it possible?
Can I do this with a Nano or a Uno board?
Thank you,
Martin