Thursday, January 27, 2011

Motorbike Gear Indicator



Here is the simple code for this project :

org 0000h
mov 2fh,#54h
mov p2,#54h
mov 30h,#06h
mov 31h,#0dbh
mov 32h,#4fh
mov 33h,#66h
mov 34h,#6dh
mov r1,#2fh

main:
mov a,p0
cjne a,#0feh,main2
acall delay
inc r1
mov p2,@r1
sjmp main
main2:
cjne a,#0fdh,main
acall delay
dec r1
mov p2,@r1
sjmp main
delay:
MOV R3,#8
MOV R2,#8
MOV R0,#236
Delay2:
DJNZ R0,Delay2
DJNZ R2,Delay2
DJNZ R3,Delay2
RET
END

THE PCB IS OK TESTED,
U can use a Reed switch instead of a hall sensor

Complete source with Proteus simulator ckt

http://www.megafileupload.com/en/file/299016/moter-bike-gear-indicator-rar.html

No comments: