Ok... my steps...
I used a 16F877A because this is my development platform. It has all common used peripherals on board and therefor I allways start with this controller. When I'm ready I take a look at the result and decide which controler(s) to use in the final version.
You only need to 'translate' two signals. Which is ECT (Engine Coolant Temperatur) and VSS (Vehicle Speed Sensor)
ECT is an analog input signal and an PWM-ish output.
VSS is a digital-ish input signal and a digital output signal.
For this converter job I decided to use two controlers for the final version. I'm not that experienced with embedded software yet.
Because the generated ECT signal is a bit odd, I'm not able to save much CPU time to proces the incomming VSS signals. So doing translation in different controllers was the easiest way for me. It can also save you money from a controller point of view. My final versions will be with a 12F675 for the ECT conversion and a 16F628A for the VSS conversion. Both controlers together are cheaper then one 16F877A
And another point from my side... I use a free version of PicBasic. This free version is limited to 50 lines of code. I wasn't able to put both conversions in just 50 lines of code (including config and declaration lines)
You should be able to create a converter with less then $20 of parts
(excluding a chip progger)
To make it even more odd.... I use the PWM module to create an accurate 50% square wave for VSS translation
The PWM module can be fed with a very precise frequency value and do it's job... without using CPU time. VSS input is an external interupt.
Oh... be carefull.... the PWM module has frequency limits. It can generate frequencies up to 35535Hz.
The low limit is depending on the clock frequency. I'm using a 4MHz crystal. @4MHz the PWM can not create frequencies lower then 245Hz. As a result of this you are not able to show a speed lower then 10Km/h (6MPH)
So what I have done to solve this issue... I multiply the desired frequency by 4. This way speed measurements of 3km/h (1~2 MPH) are within reach. But... the output frequency is now 4 times higher then desired. By adding a 7490 counter IC, configured to do a frequency division by 4, you can again correct the signal to meet desired specs for the gauge. And this way you ARE able to generate a frequency lower then 245Hz, although the pic isn't.
Multiply by 8 will give you the ability to measure even lower speeds BUT.... it also make the PWM reach it's upper limit at 160km/h (100MPH) A 4 multieplier/divider setup was the best consension to have an almost full scale converter with PWM use. It now measures 3km/h up to 300km/h.
You don't have to do anything with the tacho signal. It's the standard Tacho signal from the module. Honda is still using the same specs for that signal as they did in the 1990's
12V power supply is fine. I use an old PC power supply and tied B4 and B5 together. On a dev board saving illumination and kmh/mph settings isn't that important.
You also need a very very stable 5V supply for the converter/controller. I tapped into the S2000 PCB as it has a very very stable 5V on board.
I use the Willem programmer (
www.willem.org) It has ICSP capabilities, which makes it possible to program the controller without removing from the board. I already had the Willem progger before I started this S2000 gauge project. There are other simpler proggers if you only want to do ICSP stuff.
You have 240V mains? Were are you from?
It is a long post. I'm not sure what it did and/or didn't tell. So if there are more questions.... ask them.
For ECT conversion...
I read the analog input.
Based on this analog input I lookup the time the output should be low.
High output is always 30ms.
Set output to high, wait for 30ms
Set output to low, wait for ***ms
Read analog input
Lookup low time
Set output high, wait for 30ms
Set output low, etc. etc. etc.
For VSS conversion...
Read pulse
if timer stopped, start timer and wait for next pulse
else read timer value (this is the time between two input pulses)
calculate desired output frequency
set PWM to the desired frequency
wait for the next pulse.
if no next pulse is received (timeout after say 1.5 to 2 seconds) stop PWM module and timer.
so the output is something like: