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

Problem in displaying Characters in LCD Module

Status
Not open for further replies.

vamanan

Full Member level 2
Joined
Aug 9, 2005
Messages
135
Helped
10
Reputation
20
Reaction score
4
Trophy points
1,298
Location
India the Great
Activity points
2,286
mov datalcd,#38h

I am interfacing LCD module with 8051.When I am executing the program, the data I am sending is just visible in the LCD
Module and immediately everything turns complete black.When I am switching the power off the data just visibles again in the
LCd for a moment and then everythings go to blank.Can anybody help me in curing my headache.
My programme is

; UNDER DEVELOPMENT

$MOD51

DATALCD EQU P2 ; DATA AT PORT 2
EN EQU P3.4 ;
RW EQU P3.5 ; EN, R/W, RS SIGNALS
RS EQU P3.6 ;
CHRNUM EQU 10H ; NUMBER OF CHARACTERS IN A LINE (16 CHARACTERS ie. 10H)

ORG 0000H

CALL INIT ; INITIALISE THE LCD MODULE
CALL CLEAR ; CLEAR THE LCD MODULE

MOV DPTR, #LINE1 ;
MOV R1, #CHRNUM ;
MOV A, #00H ; ROUTINE TO DISPLAY
MOV R2, #00H ; THE FIRST LINE
WRTL1: MOVC A, @A+DPTR ; FROM LOOKUP TABLE
CALL PUTTXT ;
INC R2 ;
MOV A, R2 ;
DJNZ R1, WRTL1 ;

CALL NEWLN

MOV DPTR, #LINE2 ;
MOV R1, #CHRNUM ;
MOV A, #00H ; ROUTINE TO DISPLAY
MOV R2, #00H ; THE SECOND LINE
WRTL2: MOVC A, @A+DPTR ; FROM LOOKUP TABLE
CALL PUTTXT ;
INC R2 ;
MOV A, R2 ;
DJNZ R1, WRTL2 ;

SJMP $


INIT: SETB EN
CLR RS
CLR RW
MOV DATALCD, #38H
CLR EN
CALL WAIT

SETB EN
CLR RS
CLR RW
MOV DATALCD, #0EH
CLR EN
CALL WAIT

SETB EN
CLR RS
CLR RW
MOV DATALCD, #06H
CLR EN
CALL WAIT

RET

CLEAR: SETB EN
CLR RS
CLR RW
MOV DATALCD, #01H
CLR EN
CALL WAIT
RET

NEWLN: SETB EN
CLR RS
CLR RW
MOV DATALCD, #0C0H
CLR EN
CALL WAIT
RET

PUTTXT: SETB EN
SETB RS
CLR RW
MOV DATALCD, A
CLR EN
CALL WAIT
RET

WAIT: SETB EN
CLR RS
SETB RW
MOV DATALCD, #0FFH ; PORT2 INPUT MODE
MOV A, DATALCD
JB ACC.7, WAIT
CLR EN
CLR RW
RET

;;;;;;;;;; 'FFFFFFFFFFFFFFFF'
LINE1: DB 'xxxxxxxxxxxxxXXX'
LINE2: DB 'XXXXXXXXXXXXXXXX'

END
 

sento

Junior Member level 2
Joined
Aug 23, 2005
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,504
May be problem with CONTRAST setting ...
 

vamanan

Full Member level 2
Joined
Aug 9, 2005
Messages
135
Helped
10
Reputation
20
Reaction score
4
Trophy points
1,298
Location
India the Great
Activity points
2,286
The contrast pin I permanently connected to ground.
Does it create any problem.
 

sento

Junior Member level 2
Joined
Aug 23, 2005
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,504
Try resistor 5k6 between Contrast pin and Gnd
 

vamanan

Full Member level 2
Joined
Aug 9, 2005
Messages
135
Helped
10
Reputation
20
Reaction score
4
Trophy points
1,298
Location
India the Great
Activity points
2,286
Sento,
AFter connecting resistor as mentioned by you, the problem is solved.
Thanking You.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top