Problems with BS2sx and LCD
mhc
Posts: 6
Hello,
i tried to use a LCD Display with my Basic Stamp. For this i used a manual from a book. But it doesn't work. The light of the LCD is on an the contrast works also. But there was no text. I've attached the code. It would be nice if someone could help me.
thanks,
Marco
i tried to use a LCD Display with my Basic Stamp. For this i used a manual from a book. But it doesn't work. The light of the LCD is on an the contrast works also. But there was no text. I've attached the code. It would be nice if someone could help me.
thanks,
Marco
Comments
The problem seems to be that you're using DIR1 (DIR ONE) instead of DIRL (DIR EL) -- so you're only making P1 an output instead of P0 - P7. Also, you don't need to modify the DIR register in your WrLCD routine as you are not reading from the LCD. I recently rewrote some LCD -- you can find useful routines for the BS2 family (not BS2p or·pe which have built-in commands)·below:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/20/2004 2:29:11 PM GMT
I have actually tested this with a 4x20 LCD and it works perfectly.· The code has extra goodies that you'll ultimately be able to take advantage of.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/20/2004 3:20:40 PM GMT
THE BASIC STAMP!
AMP!··· P B A S I C
A PIC16C57 knows
nows Parallax
Whats the reason for this???
thanks,
Marco
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Write a program that clears the display, then writes a '*' to a character location; use DEBUG to show you what the location is. Make sure there's enough PAUSE time in the loop to allow you to check the display and write down the column 0 addresses for each line.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/22/2004 7:13:36 PM GMT
thanks,
Marco
According to your LCD docs, the line addresses should be:
L1 = LcdDDRam + $00
L2 = LcdDDRam + $20
L3 = LcdDDRam + $40
L4 = LcdDDRam + $60
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/22/2004 7:18:26 PM GMT
Theres something in the ks0073 datasheet about the extension function set that talks about 4 line modes but i dont understand how to control it on the initialization, im sure that could be the problem =S
Post Edited (Scarecrow) : 7/23/2005 12:12:52 PM GMT
btw addresses are:
line1: $00
line2: $14
line3: $40
line4: $54
char = %00101100 'enter extended function set
GOSUB LCDcmd
char = %00001001 '4 lines
GOSUB LCDcmd
char = %00101000 'exit extended function set
GOSUB LCDcmd
char = %00001100 ' display on, cursor off, blink off
GOSUB LCDcmd
char = %00000110 ' inc crsr, no disp shift
GOSUB LCDcmd