Home Made Digital Tachometer for My Car with LED Bar Graph and Gear Shift Warning LED
HI, THIS IS MY FIRST POST HERE
I build this tacho coz my car doesn't hv any factory fitted Tachometer. Even with the factory fitted Analog RPM Meter its hard to measure precise RPM Of the Engine. And digital Tachometers r really awesome. Thats y i build it
So guys please check it out and give me ur comment.
<ATTACH>\\PASSAN-13571\My Documents\Files For Sharing\Zoomzoom.rar</ATTACH>
I want to have one of them plz.
I cannot see you're file. can you plise post it on rapidshare or email me.
sanjeet.malund@hotmail.com
I never finished this project so it is not fully tested but should give you some ideas. Don't ask how it works as I have a short memory and it was about 10 years ago.
/***************************************************************************** shift.c ATMEL 89C2051 source file ****************************************************************************** -------v------ RST |1 20|VCC conf 1 P3.0|2 19|P1.7 \ conf 2 P3.1|3 18|P1.6 | XTAL1|4 17|P1.5 | XTAL2|5 16|P1.4 |- Data out LED's conf 3 P3.2|6 15|P1.3 | conf 4 P3.3|7 14|P1.2 | (T0) P3.4|8 13|P1.1 | input-> (T1) P3.5|9 12|P1.0 / GND|10 11|P3.7 OKLED -------------- XTAL = 11.0592 MHz *****************************************************************************/ #include "shift.h" typedef unsigned char byte; typedef unsigned int word; byte cyclecount=0,slowcount=0,update=0; byte spqs = 0, cyclefactor = 4; /**************************************************************************** counter/timer 1 is counting pulses counter/timer 0 causes interrupt 1 every 30/90 ms !P3.0 and !P3.1 selects normal 0->8KRPM P3.0 selects 0->2 KRPM P3.1 selects 6->8 KRPM both selects binary (debug) mode !P3.2 and !P3.3 selects 4 cylinders P3.2 selects 6 cylinders P3.3 selects 8 cylinders // cyclefactor is calculated such that 32 sparks in // 0.3s x cyclefactor equals 8000 rpm // ie. // 120ms for 4 cyl // 90ms for 6 cyl // 60ms for 8 cyl spqs is now sparks in the sample period On a 4 cylinder 4 stroke car there are 2 sparks per revolution rpm = (spqs/2) * 100 = spqs*50 ****************************************************************************/ main() { byte invalid = 0; byte low,leds; LEDOK = 1; P1 = 0xFF; TH0 = 0x00; /* interrupt period is 11059200/(12*(256-x)) seconds = 1/3600 */ TL0 = 0x00; TH1 = 0x00; TL1 = 0x00; TMOD = 0x62; /* TMOD 0XX0 00X0 Counter 1 is an 8 bit auto reload. Timer 0 is an 8 bit auto reload timer */ TCON = 0x5A; /* TCON 0X0X X0X0 Run counter 1 and timer 0 */ IE = 0x82; /* X00000X0 Global Enable & Timer 0 enable */ while (1) // infinite loop { while (!update) { /* idle loop */; } update = 0; if (P32 && !P33) cyclefactor = 3; else if (!P32 && P33) cyclefactor = 2; else cyclefactor = 4; /* only display value if not 0 */ if (spqs) { /* if no jumpers are present, put value as binary */ if (P30 && P31) { P1 = ~spqs; } else { if (P31) { low = 24; } else { low = 0; } if (spqs<=low) { leds = 0; } else { leds = spqs - low; if ( !P30 && !P31) leds>>=2; } if (leds >= 8) P1 = 0x00; else P1 = ~((0x01 << leds)-1); } } else { /* if no signal is present, scroll LED round */ P1 = ~(1<<invalid); invalid++; if (invalid>=8) invalid = 0; } } } /* cycle is called by a timer 0 interrupt. */ /* so interrupt routine is called every 1/3600 seconds */ /* slowcount goes up to 108 so outer loop runs every 0.03s */ cycle () interrupt 1 { if (++slowcount>=108) // runs loop every 30 ms { slowcount=0; if (++cyclecount>=cyclefactor) // increment counter upto number { cyclecount=0; LEDOK=!LEDOK; // Toggle LED spqs = TL1; // load sparksperquatersecond TL1 = 0x00; // reset counter update = 1; } } return; }
woweee
thats really excelente . thanx
it looks VERY compilcated code so I am glad you put good comments in so i can Understand it,,,,, maybe when i Study To 120%.
do you have a printed pcb ? or know where i Can buy One for it,,,, maybe on ebay??
it looks VERY compilcated code so I am glad you put good comments in so i can Understand it
this is lunacy. the OP did not even specify which processor he uses. wowee, you twit :-)
you should show Respect for people,,,,, why call someone a twit????? we are Different people and Have different experiences of Life!!!!
i Think the Code is very good,,,,,,,, but i Need to read it More b4 I can UnderstAnd it 100%
i Think the OP can use the code for his project.,,,,, it is In C and is portable.
alright, alright, I did not mean to offend you... I just tried to point out that it is likely that your code is likely strongly bound to a certain hardware platform - whether it is a processor or the actual device you're working with...sorry again!
Say, are you somehow related to the god, the master, the genius, the Ba'al, the wonder, the blessing from the heavens "eric malund"?
PS Erik - I have a lot of respect for you, you know that! Just joking again!
Michael,
OK, I am a twit. I never noticed no toolset was specified. I saw the reply from Mr Malund II and thought I could help as I did the same sort of thing myself for fun. I hoped the code I posted would help/encourage him to try and make his own.
Sanjeet,
I never made a PCB, it was just on a bit of stripboard. Apart from the micro there was an opto-coupler on the input and an LED 'bargraph' (and resistor network) on the output port. Oh and the usual crystal, caps and voltage regulator. The comments in the code aren't much use describing how it works, but if you are keen to learn then you should be able to figure it out.
The problem is it has nothing to do with keil tools, so we will get told off if the thread gets any longer. You are welcome to take the code and ask in a different general forum if you want help with it.
this is very bad,,,,,,,,,,
i have a reletive who we call erec but i do not know if he is the one you say????
erec is the one we always say is the sheep with seven legs,,,, we do not like to speak about him,,,,, or bad crops come to us
I don't think our Erik has seven legs, but I am quite sure he is also known by the nickname 'sir erac'. search the forum for 'rahib kalib', the master of submission :)
yes sir erac has ansewrs for to be thinking he is wise and old and good and funney but he not be ansewr questiens nice
he say reed the bible very much and crawel and walk but not be running and he thiniking metafors are making him looking clever but some poeples see his badness
he has seven legs???? the freind has big picture of sir erac sit at table with eat food on wall but we not be seeing with legs
is sir erac hides big seceret????
Here you will see the evidence ...
www.geocities.com/.../two_legs.html