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.

connecting LCD to 8051

Status
Not open for further replies.

artemb

Newbie level 2
Joined
Aug 20, 2007
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
hi all,
i have a Silicon Laboratories 8051F330 micro controller development board and a lumex LCD (data sheet - https://www.lumex.com/pdf/LCM-S01602DSF+A.pdf).

i am trying to connect the LCD to the 8051.
i tried to connected the LCD directly to the 8051, but that doesn't seem to work.
any one have any suggestion?
and also does the LCD display anything if its connected correctly but with out any setting on the 8051?

thank you
 

Hi,

Download the User's Manual for the 16 x 2 character LCD from the following link..
Hope it will help you...

**broken link removed**
 

At this URL
**broken link removed**
scroll down to see 2 tutorials on LCDs and the 8051

-Aubrey
 

make sure that u connect lcd truely to uc (best way use of manual or books)
1-vss connected to gnd
2-vdd connected to +5
3-an 10k potentiometer connected between 0,5 and midding pin to v0.
4-control pin(rs/rw/e)connected truely to uc and your program is fine.
first connect supply and by spin pot10k adjust ligh intensity.
 

antedeluvian thx for the link, but i already read the tutorial about the lcd's(my lcd data sheet - https://www.lumex.com/pdf/LCM-S01602DSF+A.pdf). i also tried the to use the program from the 8052.com tutorial on my Silicon Laboratories 8051F330 but it doesnt seem to work.

here is the code:

$NOMOD51

$include (c8051f330.inc) ; Include register definition file.

;-----------------------------------------------------------------------------
; RESET and INTERRUPT VECTORS
;-----------------------------------------------------------------------------

; Reset Vector
cseg AT 0
ljmp Main ; Locate a jump to the start of
; code at the reset vector.
DB0 EQU P0.0
DB1 EQU P0.1
DB2 EQU P0.2
DB3 EQU P0.3
DB4 EQU P0.4
DB5 EQU P0.5
DB6 EQU P0.6
DB7 EQU P0.7
EN EQU P1.5
RS EQU P1.7
RW EQU P1.6
LCDDATA EQU P0

WAIT_LCD:

CLR EN ;Start LCD command
CLR RS ;It's a command
SETB RW ;It's a read command
MOV LCDDATA,#0FFh ;Set all pins to FF initially
SETB EN ;Clock out command to LCD
MOV A,LCDDATA ;Read the return value
JB ACC.7,WAIT_LCD ;If bit 7 high, LCD still busy
CLR EN ;Finish the command
CLR RW ;Turn off RW for future commands
RET
; following program code.
INIT_LCD:

CLR RS
MOV LCDDATA,#38h
SETB EN
CLR EN
LCALL WAIT_LCD
CLR RS
MOV LCDDATA,#0Eh
SETB EN
CLR EN
LCALL WAIT_LCD
CLR RS
MOV LCDDATA,#06h
SETB EN
CLR EN
LCALL WAIT_LCD
RET

CLEAR_LCD:

CLR RS
MOV LCDDATA,#01h
SETB EN
CLR EN
LCALL WAIT_LCD
RET

WRITE_TEXT:

SETB RS
MOV LCDDATA,A
SETB EN
CLR EN
LCALL WAIT_LCD
RET

Main:
; Disable the WDT.
anl PCA0MD, #NOT(040h) ; clear Watchdog Enable bit

mov P0MDOUT, #00h
mov P1MDOUT, #00h
mov XBR0, #40h ; assignments
mov XBR1, #40h ; enable Crossbar

LCALL INIT_LCD
LCALL CLEAR_LCD
MOV A,#'H'
LCALL WRITE_TEXT
MOV A,#'E'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#' '
LCALL WRITE_TEXT
MOV A,#'W'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#'R'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'D'
LCALL WRITE_TEXT

END



and i can figure out were the problem is could some one send me a working example?
i am a beginner so dont really know how to configure the ports. could someone tell me if its done right in the example above?
tnx all
artem
 

use Ayala as reference book and also u can get enough information form below


**broken link removed**
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top