zam e Posted May 3, 2012 Report Share Posted May 3, 2012 i want to make this project...it will count time passenger in cab...then the time change to value that it must pay...example : 10 minute for 1 dollar.......20 minute for 2 dollar... Quote Link to comment Share on other sites More sharing options...
Hero999 Posted May 3, 2012 Report Share Posted May 3, 2012 Where's the schematic and code? Quote Link to comment Share on other sites More sharing options...
zam e Posted May 3, 2012 Author Report Share Posted May 3, 2012 i dont have it..could u give any suggestion..i'm very thankful for it... Quote Link to comment Share on other sites More sharing options...
Hero999 Posted May 3, 2012 Report Share Posted May 3, 2012 Sorry, no ones going to do your project for you. This is not a free electronic design service, I apologise if that's not clear. Electronics Lab is a forum where people help each other with their projects.If you want someone to design your project for you, they'll more than likely charge you a fee and require you to supply them with a design specification first. Quote Link to comment Share on other sites More sharing options...
zam e Posted May 6, 2012 Author Report Share Posted May 6, 2012 LIST P=PIC16F84PORTA EQU 05HPORTB EQU 06HCOUNTER EQU 37Hibyte EQU 020Lobyte EQU 021Count EQU 26Tents EQU 022Thous EQU 023Hunds EQU 024Tens EQU 025Ones EQU 028d1 EQU 019d2 EQU 018d3 EQU 017Timer1 EQU 29TimerX EQU 2APoint EQU 2B ; Program table pointer Select EQU 2C ; Copy of RS bitOutCod EQU 2D ; Temp store for output codeRS EQU 1 ; Register select output bitE EQU 2 ; Display enable NUM_HIGH EQU 30HNUM_LOW EQU 31HX1 EQU 32X2 EQU 33X3 EQU 34ORG 100HGOTO STARTORG 0HSTART MOVLW B'00000001' TRIS PORTA MOVLW B'00000000' TRIS PORTB CALL InitLCD CALL Out_LCD0 CLRF PORTBLOOP BTFSS PORTA,0 GOTO START CALL Out_LCD1 CALL DELAY BTFSS PORTA,0 GOTO START CALL Out_LCD2 CALL DELAY BTFSS PORTA,0 GOTO START CALL Out_LCD3 CALL DELAY GOTO LOOPRETURNDELAY ;30minutes delay movlw 0xB6 movwf d1 movlw 0x64 movwf d2 movlw 0x20 movwf d3Delay30min_0 decfsz d1, f goto $+2 decfsz d2, f goto $+2 decfsz d3, f goto Delay30min_0 nop return;-----------------------------------------------------------------------------------------------------------Out_LCD1: BSF Select,RS ; Set display data mode MOVLW 'R' ; Time period CALL send ; Display it MOVLW 'M' ; Space CALL send ; Display it MOVLW ' ' ; Equals CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it; Show fixed characters---------------------------------------------------------------------------- MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; micro CALL send ; Display it MOVLW '3' ; secs CALL send ; Display it MOVLW '.' ; Space CALL send ; Display it MOVLW '0' ; Space CALL send ; Display it MOVLW '0' ; Space CALL send ; Display it; Home cursor----------------------------------------------------------------------------------------- BCF Select,RS ; Set display command mode MOVLW 0x80 ; Code to home cursor CALL send ; Do it RETURN ; done;------------------------------------------------------------------Out_LCD2 BSF Select,RS ; Set display data mode MOVLW 'R' ; Time period CALL send ; Display it MOVLW 'M' ; Space CALL send ; Display it MOVLW ' ' ; Equals CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it; Show fixed characters---------------------------------------------------------------------------- MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; micro CALL send ; Display it MOVLW '3' ; secs CALL send ; Display it MOVLW '.' ; Space CALL send ; Display it MOVLW '1' ; Space CALL send ; Display it MOVLW '0' ; Space CALL send ; Display it; Home cursor---------------------------------------------------------------------------------------- BCF Select,RS ; Set display command mode MOVLW 0x80 ; Code to home cursor CALL send ; Do it RETURN ; done;------------------------------------------------------------------Out_LCD3 BSF Select,RS ; Set display data mode MOVLW 'R' ; Time period CALL send ; Display it MOVLW 'M' ; Space CALL send ; Display it MOVLW ' ' ; Equals CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it; Show fixed characters---------------------------------------------------------------------------- MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; micro CALL send ; Display it MOVLW '3' ; secs CALL send ; Display it MOVLW '.' ; Space CALL send ; Display it MOVLW '2' ; Space CALL send ; Display it MOVLW '0' ; Space CALL send ; Display it; Home cursor---------------------------------------------------------------------------------------- BCF Select,RS ; Set display command mode MOVLW 0x80 ; Code to home cursor CALL send ; Do it RETURN ; doneOut_LCD0 BSF Select,RS ; Set display data mode MOVLW 'W' ; Time period CALL send ; Display it MOVLW 'E' ; Space CALL send ; Display it MOVLW 'L' ; Equals CALL send ; Display it MOVLW 'C' ; Space CALL send ; Display it MOVLW 'O' ; Space CALL send ; Display it MOVLW 'M' ; Space CALL send ; Display it; Show fixed characters---------------------------------------------------------------------------- MOVLW 'E' ; Space CALL send ; Display it MOVLW ' ' ; micro CALL send ; Display it MOVLW ' ' ; secs CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it MOVLW ' ' ; Space CALL send ; Display it; Home cursor---------------------------------------------------------------------------------------- BCF Select,RS ; Set display command mode MOVLW 0x80 ; Code to home cursor CALL send ; Do it RETURN ; done; MAIN LOOP----------------------------------------------------------------------------------------- send MOVWF OutCod ; Store output code ANDLW 0FF ; Clear low nybble MOVWF PORTB ; Output high nybble BTFSC Select,RS ; Test RS bit BSF PORTB,RS ; and set for data CALL PulseE ; and clock display CALL Onems ; wait 1ms for display SWAPF OutCod ; Swap low/high nybbles MOVF OutCod,W ; Retrieve output code ANDLW 0FF ; Clear low nybble MOVWF PORTB ; Output low nybble BTFSC Select,RS ; Test RS bit BSF PORTB,RS ; and set for data CALL PulseE ; and clock display CALL Onems ; wait 1ms for display RETURN; SUBROUTINES------------------------------------------------------------------------------------; 1ms delay with 1us cycle time (1000 cycles)-------------------Onems MOVLW D'249' ; Count for 1ms delay MOVWF Timer1 ; Load countLoop1 NOP ; Pad for 4 cycle loop DECFSZ Timer1 ; Count GOTO Loop1 ; until Z RETURN ; and finish; Delay Xms, X received in W -----------------------------------Xms MOVWF TimerX ; Count for X msLoopX CALL Onems ; Delay 1ms DECFSZ TimerX ; Repeat X times GOTO LoopX ; until Z RETURN ; and finish; Generate data/command clock siganl E -------------------------PulseE BSF PORTB,E ; Set E high CALL Onems ; Delay 1ms BCF PORTB,E ; Reset E low CALL Onems ; Delay 1ms RETURN; Initialize the display -------------------------------------------------------------------------------InitLCD MOVLW D'100' ; Load count 100ms delay CALL Xms ; and wait for display MOVLW 0F0 ; Mask for select code MOVWF Select ; High nybble not masked MOVLW 0x30 ; Load initial nibble MOVWF PORTB ; and output it to display CALL PulseE ; Latch initial code MOVLW D'5' ; Set delay 5ms CALL Xms ; and wait CALL PulseE ; Latch initial code again CALL Onems ; Wait 1ms CALL PulseE ; Latch initial code again BCF PORTB, 4 ; Set 4-bit mode CALL PulseE ; Latch it MOVLW 0x28 ; Set 4-bit mode, 2 lines CALL send ; and send code MOVLW 0x08 ; Switch off display CALL send ; and send code MOVLW 0x01 ; Clear display CALL send ; and send code MOVLW 0x06 ; Enable cursor auto inc CALL send ; and send code MOVLW 0x80 ; Zero display address CALL send ; and send code MOVLW 0x0C ; Turn on display CALL send ; and send code RETURN ; Done END Quote Link to comment Share on other sites More sharing options...
zam e Posted May 6, 2012 Author Report Share Posted May 6, 2012 this is my coding...it have problem... it only execute display 5 times only...after that it have overwrite error... i dont know how to solve it... Quote Link to comment Share on other sites More sharing options...
zam e Posted May 6, 2012 Author Report Share Posted May 6, 2012 i have the circuit..how to show here... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.