Sunday, May 15, 2005

Getting the original guages to work

RVC Gagues electronics scheme

After we managed to make the gauges work by "implanting" servo's in them, we decided that it's not good enough, since we would like the original car to remain unmodified as much as possible.

The guages needles move according to the frequency that they receive. Since it is impossible to generate those frequencies from Windows (or any other non real-time OS), we needed to move into hardware (yeah!).

We decided to go with Atmel AVR microcontroller chips (mainly because that's what we could easily find in Israel). We got a sample of an ATMEGA16 and wrote some C code to generate the frequencies (WinAVR and AVRlib). Since this is the first time we used this platform it took us a few hours to get it working.

Generating the frequencies is not enough -- you need the PC to ask the microcontroller to generate the right frequency according to the speed/rpm in the game. Unfortunatelly, the AVR cannot speak directly with an RS-232 interface, so we had to connect a MAX232 chip in order to get it working.

The sequence is as following: there is a process on the PC which collects the games telemtry with Nascar 2003 APIs. It then translate the speed/rpm to commands which are written to the microcontroller via a COM port. The microcontroller parses the requests and set the frequencies to the gauges accordingly.

Nice :-)

3 comments:

Anonymous said...

Awsome work! I would love to see the movie when it becomes available again.

So how do you guys like the ATMEGA16 chip? was it a bear to get hopping through the hoops?

I did think you might like the Dallas DS275 for your serial port as it doesent need the extra 4 10uf capacitors and is a smaller package to boot. :-) Probably not a concern at this stage, but if you make a pcb - it might help reduce price/cost/parts a few pennies. (heh)

Keep up the good work - very facinating to see how you guys are doing!

Yuvster said...

I like the ATMEGA16 chip as it's hard-core + There's free GCC + libraries on the web. Once you use the libraries for the AVR, it's a snap (although the generated code is quite large compared to BASCOM for example). We were not able to put our hands on the DS275 so we settled for the MAX232 with the hassle of the capacitors.

Anonymous said...

Hi #NAME#. Just found your site via satellite. Although I was looking for satellite I was glad i came upon your site. Thanks for the read!