hello all,
i know there r lot of circuits regarding the tachometers.i did the search but couldn't find one,which uses pic and led's
so after a lot of search over net i found below circuit. http://www.walktronics.de/html/led-drehzahlmesser.html
all i need from u ppl is confirming the code.i don't have much knowledge of coding.but i can make HEX and burn it on chip.(using MPLAB)
the author said the code is for 4-cylinder engine.but mine is single-cylinder,4-stroke(dirt bike...)
can u guys help me with this issue?
It's hard to tell what it's doing as I don't read German. Looking at the code and the schematic, it looks like the pic is counting pulses on RA0. It counts pulse for a fixed time that is set in the routine called "Timer". By adjusting the value shown in red below, you should be able to get it to work on your bike. If the value is outside the range of a byte then changing timer0 prescaler should sort it out.
Code:
TIMER
clrwdt
btfss INTCON,2 ; Bit für TMR0-Überlauf, 1 wenn passiert
RETURN
bcf INTCON,2
decfsz TIMEREG1,f
RETURN
movlw [COLOR="Red"]0x92[/COLOR] ;3D=61(20MHz), Teilerfaktor für 0,05 sec (20,01Hz)
movwf TIMEREG1
call DISPLAY ; Wenn die Zeit rum ist: RESET...
call RESET
call ROTATE
RETURN
If you build the circuit, I'm sure there are lot's of posters here that will help and probably build their own.
1. it does not matter whether four cylinders or two cylinders..
because the tachometer is to be used only with engine wheel..
2. make your own one.. i'll guide you...
" use tape recorder motor that runs slow.. attach it with ADC ... of which o/p goes to PIC ... then .. the pic controller is also connected with Display "
thanks for the replies guys.
my motorcycle uses CDI ignition system.so i will be getting clean pulse to input the above circuit.
so can i use same code as it is with out any modifications?
and this circuit using 32LEDs.i don't want so many.so iam planning to use even led numbers.
i mean d2,d4,d6...d32.over all 16 in number.
i am using multiPIC to burn PIC's.soon i'll built the circuit. and will post the result.
mean while any more suggestions will be welcome.
i complied the given program using MPLAB.
it sure created some files along with the HEX.and the console is showing below data.
i hope every thing went ok.pls do check the ASM and HEX. posted below
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F874A "tacho.asm" /l"tacho.lst" /e"tacho.err"
Message[301] C:\PROGRAM FILES\MPLAB IDE\MCHIP_TOOLS\P16F874.INC 39 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 183 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 185 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 187 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 189 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 191 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 193 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\POWER\DESKTOP\TACHO.ASM 196 : Register in operand not in bank 0. Ensure that bank bits are correct.
Loaded C:\Documents and Settings\power\Desktop\tacho.COD
BUILD SUCCEEDED: Sat Sep 15 00:27:55 2007
well i tried yesterday with the program and the circuit.but it doesn't workout.
may be its bcz iam using p16F874A instead of p16F874
any more idea s guys
The obvious one is to put a sensor on the crankshaft/flywheel and use that to determine RPM. This one will always be correct no matter how many cylinders you have.
However there are other ways: You can even sample the coil pack input if done carefully (magneto systems may require special care, but most electronic ignition systems should be fairly easy.) - then this you will have to divide by the half the number of cylinders you have since each revolution, half the number of cylinders go through power stroke on an Otto, 4-cycle engine. For instance, for a four cylinder, you'd need to divide by 2. For a single-cylinder, you need to MULTIPLY by 2. For engines with weird configurations, like 3-cylinder I think this still works and you will have to deal with fractions. If you use Wankel cycle or two-cycle you'll have to change this.
Another way that's done by yet more advanced system is listen to electrical noise from the kickback of the coil system or alternator to the electrical system. This also has the division issue. This method has the added benefit of being totally passive, but the sense electronics is much more complicated.
So, how are you planning to connect the sense to the motor?
as my motorcycle uses CDI ignition system,i'll be getting clean pulse.so generating pulse is not a problem for me.
my requirement is a tacho which uses min components and uses LED to display the RPM.i can use LM2917 with LED driver chip but the issue is i don't have much space at my vehicle panel.so while searching for simple one i found above circuit.as it uses only one chip.
any way thanks for the explanation.
if u guys have any more tacho ideas pls do share.
thanks
i complied the given program using MPLAB.
it sure created some files along with the HEX.and the console is showing below data.
i hope every thing went ok.pls do check the ASM and HEX. posted below
hi steev,
how about the purposes is only a small rpm counter for motor bike, single cylinder and max rpm that engine can reach is only bellow 1500rpm, is this case need any modification on the software code ? if so could you please guide me !