2x16 Parallel LCD - Not working?
everest
Posts: 141
I now have TWO 2x16 stock LCDs from Parallax. I've tried connecting both of them directly to the dedicated LCD connection on my professional development board, and connecting all three pins as indicated in the sample code for the LCD. . .and I see absolutely nothing on my LCDs. . .zippo. . .am I just missing something fundamental here???? Strange for something right out of the box on a dedicated development board all from the same manufacturer, with their own code to just not work. I suspect a bonehead move on my part!
-Jeff
-Jeff
Comments
Did you set the serial rate with the two switches on the back of the LCD? There's also a pot on the back of the LCDs and it adjusts the contrast. Check that adjustment as well.
I don't have the parallel version (which I assume everest is talking about), but it appears that the baud isn't selectable. I think you're thinking of the serial LCD
@everest
Assuming that you're talking about the parallel LCD, according to the LCD datasheet you need to dedicate 7 I/O pins for four bit mode, which is what the sample code does. Have you used jumpers to connect all 7 pins?
The program runs fine, but neither LCD does a darn thing. . . .
-Jeff
' =========================================================================
' File...... Parallel_LCD_2X16.bs2
' Purpose... Parallel LCD Display Demo
' Author.... Parallax, Inc.
' E-mail.... support@parallax.com
' {$STAMP BS2}
' {$PBASIC 2.5}
'
[noparse][[/noparse] Program Description ]
' This program demonstrates using a Hitachi-compatible Parallel LCD Display
' This code works with the BS2, BS2e and BS2sx
'
[noparse][[/noparse] I/O Definitions ]
E PIN 0 ' Enable Pin For LCD
RW PIN 2 ' R/W Pin For LCD
RS PIN 3 ' LCD Register Select
' 0 = Instruction, 1 = Text
'
[noparse][[/noparse] Variables ]
char VAR Byte ' Character To Send To LCD
inst VAR char ' Induction To Send To LCD
index VAR Word ' Character Pointer
temp VAR Byte ' Temp Variable
'
[noparse][[/noparse] EEPROM Data ]
DATA "Hello, this is the LCD demo." ' Message To Send To LCD
'
[noparse][[/noparse] Initialization ]
Initialize:
LOW RW ' Set LCD To Write Mode
OUTS = %0000000000000000 ' Set All Output Low
DIRS = %0000000011111111 ' Set I/O Direction
GOSUB Init_Lcd ' Initialize The LCD Display
'
[noparse][[/noparse] Program Code ]
Main:
FOR temp = 0 TO 27 ' 28 Characters
IF temp = 15 THEN ' Check For End Of Line
GOSUB Next_Line ' Jump To Next Line
ENDIF
READ temp, char ' Read Next Character From EEPROM
GOSUB Send_Text ' Send Character To LCD Display
NEXT
END
'
[noparse][[/noparse] Subroutines ]
Init_Lcd:
PAUSE 200
OUTS = %00110000 ' Reset The LCD
PULSOUT E,1 ' Send Command Three Times
PAUSE 10
PULSOUT E,1
PAUSE 10
PULSOUT E,1
PAUSE 10
OUTS = %00100000 ' Set To 4-bit Operation
PULSOUT E,1
Inst = %00101000 ' Function Set (2-Line Mode)
GOSUB Send_Inst
Inst = %00001110 ' Turn On Cursor
GOSUB Send_Inst
Inst = %00000110 ' Set Auto-Increment
GOSUB Send_Inst
Inst = %00000001 ' Clears LCD
GOSUB Send_Inst
Inst = 14 ' Set Cursor To Underline
GOSUB Send_Inst
RETURN
Send_Inst:
LOW RS ' Set Instruction Mode
OUTB = Inst.HIGHNIB ' Send High Nibble
PULSOUT E,1
OUTB = Inst.LOWNIB ' Send Low Nibble
PULSOUT E,1
HIGH RS ' Set LCD Back To Text Mode
RETURN
Send_Text:
OUTB = Char.HIGHNIB ' Send High Nibble
PULSOUT E,1
OUTB = char.LOWNIB ' Send Low Nibble
PULSOUT E,1
PAUSE 100
RETURN
Next_Line:
Inst = 128+64 ' Move Cursor To Line 2
GOSUB Send_Inst
RETURN
-Jeff
If you have the socket on your PD board for the connector, you wouldn't need to be connecting anything else to any pins on the BS as the E, RS and RW are included in the pins on the connector. Not sure if this is compounding your issue. Using the PDB socket or connecting to BS pins directly is an either-or thing. Actually, I'm not sure how you would have been able to do that anyway. Isn't the ribbon cable occupying any connections that the LCD has on it's rear? Or are you saying that you tried two different ways to hook it up.. once with the connector and once just using those three pins? I don't have a PDB, but hooking that LCD unit to the LCD connector should be using Stamp pins 0,2,3,4,5,6, & 7 in 4 bit mode, so you shouldn't be using those pins on the Stamp elsewhere for other purposes.
Rick
Put STOP after this 200 ms PAUSE.
Now you should be able to use the contrast adjustment to see the dots of the matrix characters. If you do not see any display at all you are probably missing the power connection.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·
i got the same problem as everest·has got
i connected a HD44780 lcd display to a basic stamp2, but i didnt connect it·the way it says in the example.
i connected it like this :
LCD pin······· |·· BS2· pin
1···················· 23
2···················· 21
3···················· POT
4······················5
5····················· 20
6······················19
7····················· 23
8······················23
9····················· 23
10···················· 23
11···················· 6
12····················· 7
13······················ 8
14···················· 9
please help me, searched already on google , but i couldn´t find anything
at the moment·the display shows· one line of blocks
Post Edited (blablabla) : 10/29/2009 2:00:38 PM GMT
p.s.: sorry for my bad english, but im from germany
What did you do? My parallel lcd is behaving in the exact same way. Were there any faults in your program or was it a connection issue? Please help me.
Or you use this
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 5/11/2010 12:50:37 PM GMT