Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

AT89C51 and LCD interfacing problem

Status
Not open for further replies.

ysrinivas

Newbie level 3
Joined
Dec 12, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,344
hi every one i am new to this forum..
i am doing the mini project on Micro controller based security system
in the i am using the LCD display, i am using the same code for displaying the characters on to the LCD
but i am not getting the output i verified my code on proteus also it is working but when come to
hardware i am not getting the output can anyone please help me to solve this problem i am posting my circuit diagram and code for this
ckt diagram.jpg


code:
ORG 00H
MOV SP,#60H
CLR P1.4
START: MOV A,#38H
ACALL COMNWRT
ACALL DELAY
MOV A,#0EH
ACALL COMNWRT
ACALL DELAY
MOV A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#84H
ACALL COMNWRT
ACALL DELAY
MOV A,#'I'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
STAY: SJMP STAY
COMNWRT:ACALL READY
MOV P0,A
CLR P1.2
CLR P1.1
SETB P1.0
ACALL DELAY
CLR P1.0
RET
DATAWRT:ACALL READY
MOV P0,A
SETB P1.2
CLR P1.1
SETB P1.0
ACALL DELAY
CLR P1.0
RET
READY: SETB P0.7
CLR P1.2
SETB P1.1
BACK:CLR P1.0
ACALL DELAY
SETB P1.0
JB P0.7,BACK
RET
DELAY: MOV R0,#50
MOV R1,#50
HERE: DJNZ R0,HERE
DJNZ R1,HERE
RET
 

ysrinivas

Newbie level 3
Joined
Dec 12, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,344
Post the full code. We want to see the LCD Initialization routine.
Hi this is the complete code that i am using in my project related to the circuit diagram
ORG 00H
MOV SP,#60H
START: MOV A,#38H
ACALL COMNWRT
ACALL DELAY
MOV A,#0EH
ACALL COMNWRT
ACALL DELAY
MOV A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#84H
ACALL COMNWRT
ACALL DELAY
MOV A,#'I'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
SJMP CARDCHECK
COMNWRT:ACALL READY
MOV P0,A
CLR P1.2
CLR P1.1
SETB P1.0
ACALL DELAY
CLR P1.0
RET
DATAWRT:ACALL READY
MOV P0,A
SETB P1.2
CLR P1.1
SETB P1.0
ACALL DELAY
CLR P1.0
RET
READY: SETB P0.7
CLR P1.2
SETB P1.1
BACK:CLR P1.0
ACALL DELAY
SETB P1.0
JB P0.7,BACK
RET
DELAY: MOV R0,#50
MOV R1,#50
HERE: DJNZ R0,HERE
DJNZ R1,HERE
RET
CARDCHECK:
MOV P2,#0FFH
RECHECK:MOV A,P2
CPL P3.0
CJNE A,#0FFH,CARD1
SJMP RECHECK
CARD1: CJNE A,#66H,CARD2
SJMP PASSWORD1
CARD2: CJNE A,#99H,REINSERT
LJMP PASSWORD2
REINSERT:MOV A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#81H
ACALL COMNWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'Y'
ACALL DATAWRT
LJMP START
PASSWORD1:
ACALL DISPLAY
MOV P3,#0F8H
MOV R2,#00H
PP1:JB P3.3,PP1
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#40H
JZ Q
INC R2
Q:JB P3.3,Q
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#40H
JZ R
INC R2
R:JB P3.3,R
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#40H
JZ S
INC R2
S:JB P3.3,S
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#40H
JZ CHECK
INC R2
CHECK: MOV A,R2
ADD A,#00H
JZ DR
LJMP REINSERT
DR:LJMP DOOR

PASSWORD2:
ACALL DISPLAY
MOV P3,#0F8H
MOV R3,#00H
PP2:JB P3.3,PP2
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#90H
JZ Q1
INC R3
Q1:JB P3.3,Q1
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#90H
JZ R11
INC R3
R11:JB P3.3,R11
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#90H
JZ S1
INC R3
S1:JB P3.3,S1
ACALL SHOW
MOV A,P3
ANL A,#0F0H
XRL A,#90H
JZ CHECK1
INC R3
CHECK1:
MOV A,R3
ADD A,#00H
JZ DOOR
LJMP REINSERT
DISPLAY:
MOV A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#81H
ACALL COMNWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'U'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'I'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#'Y'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#0C0H
ACALL COMNWRT
RET
SHOW:
MOV A,#'*'
ACALL DATAWRT
RET
DOOR:
MOV A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#81H
ACALL COMNWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'L'
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'M'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
SETB P1.6
CLR P1.7
SETB P3.1
CLR P3.2
ACALL DELAY1
CLR P1.6
CLR P3.1
CLR P1.5
MOV R0,#00H
CLR P1.4
WAIT:JNB P1.5,WAIT
INC R0
SETB P1.7
SETB P3.2
ACALL DELAY1
CLR P1.7
CLR P3.2
DJNZ R0,ALERT
LJMP START
ALERT:MOV A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#81H
ACALL COMNWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'L'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
SETB P1.4
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
ACALL DELAY1
CLR P1.4
LJMP START
DELAY1:
CLR P1.5
MOV R5,#12
L4: MOV R6,#200
JNB P1.5,DO
L3: MOV R7,#255
DJNZ R7,$
DJNZ R6,L3
DJNZ R5,L4
RET
DO: INC R0
SJMP L3
GO:SJMP GO
END
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top