Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pic lcd not working

Status
Not open for further replies.

yousufsaleem

Junior Member level 1
Junior Member level 1
Joined
Mar 7, 2012
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,414
if build the hex file and tryinh to run it on protues but lcd is not responding
Untitled.pngUntitled.png


#INCLUDE P18F452.INC
R2 EQU 0x2
R3 EQU 0x3
R4 EQU 0x4
R5 EQU 0x5
R6 EQU 0x6
R7 EQU 0x7
LCD_DATA EQU PORTD
LCD_CTRL EQU PORTD

RS EQU RB0
RW EQU RB1
EN EQU RB2
CLRF TRISD
CLRF TRISB
BCF LCD_CTRL,EN
CALL LDELAY
MOVLW 0x38
CALL COMMAND
CALL LDELAY
MOVLW 0x0E
CALL COMMAND
CALL READY
MOVLW 0x01
CALL COMMAND
CALL READY
MOVLW 0x06
CALL COMMAND
CALL READY
MOVLW 0x86
CALL COMMAND
CALL READY
MOVLW A'N'
CALL DATA_DISPLAY
CALL READY
MOVLW A'O'
CALL DATA_DISPLAY
HERE BRA HERE
COMMAND MOVWF LCD_DATA
BCF LCD_CTRL,RS
BCF LCD_CTRL,RW
BSF LCD_CTRL,EN
CALL SDELAY
BCF LCD_CTRL,EN
RETURN
DATA_DISPLAY MOVWF LCD_DATA
BSF LCD_CTRL,RS
BCF LCD_CTRL,RW
BSF LCD_CTRL,EN
CALL SDELAY
BCF LCD_CTRL,EN
RETURN
READY SETF TRISD
BCF LCD_CTRL,RS
BSF LCD_CTRL,RW
BACK BSF LCD_CTRL,EN
CALL SDELAY
BCF LCD_CTRL,EN
BTFSC LCD_DATA,7
BRA BACK
CLRF TRISD
RETURN


LDELAY
MOVLW D'15'
MOVWF R4
BACK2 MOVLW D'50'
MOVWF R3
AGAIN MOVLW D'250'
MOVWF R2
HERE1 NOP
NOP
DECF R2, F
BNZ HERE1
DECF R3, F
BNZ AGAIN
DECF R4, F
BNZ BACK2
RETURN
SDELAY
MOVLW D'2'
MOVWF R5
BACK1 MOVLW D'10'
MOVWF R6
AGAIN1 MOVLW D'25'
MOVWF R7
HERE2 NOP
NOP
DECF R7, F
BNZ HERE2
DECF R6, F
BNZ AGAIN1
DECF R5, F
BNZ BACK1
RETURN
END
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top