How do I hook up an LCD? (2x16 Backlight)
Masterchief1517
Posts: 29
I just bought one of these off ebay, the numbers on the front are YJ-162A, on the back RL 94V-0, YJ-162A,·plus R1, R2, R3, R4, R5, R6 which the "R" ones are next to solder spots. All I have is this screen and a BOE with a BS2. So again, how can I hook this up?
Comments
Post Edited (Masterchief1517) : 5/13/2007 8:39:04 PM GMT
Post Edited (Masterchief1517) : 5/14/2007 3:29:21 AM GMT
Vdd = 5v
Vss = GRND
Vo = Contrast on LCD, wire it to GRND for max contrast
RS = Register select
R/W = Read from LCD, Write to LCD (low = write, high = read)
E = Enable (to put data sent to data register to be displayed)
D0-D7 = Data Bits
Pin 16 on LCD· = LED+ = Vdd for led backlight connect to 5v··· (change arround if backlight doesn't come on)
Pin 15 on LCD = LED- =· Vss for led backlight connect to GRND (change arround if backlight doesn't come on)
Now, wire Vdd to the 5v line on the BOE, Vss and Vo to the GRND (gound) of the BOE.
Now, wire RS to pin0, R/W to pin1, E to pin2, D0-D7 to pin3-pin10 of the STAMP on the BOE.
Then, all you have to do is to write the software to send the data to the lcd, and me personally prefer as serial lcd, becaue I save·9 pins on the STAMP, and I just have to use the serout command to get characters onto the screen.
Hope it helps,
Wynand.
I am ataching a datasheet on the HD44780 controller, read through it and it will tell you how to interface with the lcd.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!
Post Edited (Wynand) : 5/14/2007 7:36:15 PM GMT
If you get it working, let us know.....
And good luck.....
Wynand.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Post Edited (Masterchief1517) : 5/15/2007 2:36:02 AM GMT
Makes shure that the pins in the program correspond to the pins that you wired to your LCD, ie that the data bits run from pin3-pin10 and the instruction bits are run from pin0-pin2. If I look at the code you posted, it should work. Just remember, when you run it in 8 bit mode, you have to add outputs to the instruction line of the demo program, else you will lose the 3 last data bits (since you are only addressing pin0-pin7 instead of pin0-pin10).
I hope that this clarifies it for you....
Wynand.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!
Your pins should be connected as follows:
STAMP················· :·················· LCD
pin0····················· :················· D7
pin1····················· :················· D6
pin2····················· :················· D5
pin3····················· :················· D4
pin4····················· :················· D3
pin5····················· :················· D2
pin6····················· :················· D1
pin7····················· :················· D0
pin8····················· :··················RS
pin9····················· :··················R/W
pin10··················· :·················· E
Then download the demo program attached, and run it to see if it works.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!
Post Edited (Wynand) : 5/15/2007 8:09:45 AM GMT
I have had this same problem. Have also the same display but it is alittle larger. I have posted this same question on the SX forum:
http://forums.parallax.com/showthread.php?p=650172
But have not found any simple code like what is shown above.
I do not have a·BS2 and know this is not the right forum, but was just wondering if anyone has simple code like this in SX/B.
Thanks,
Lance
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!
cgi.ebay.com/Serial-LCD-Kit-117-w-20X4-LCD-Basic-Stamp_W0QQitemZ140118573324QQihZ004QQcategoryZ4661QQssPageNameZWDVWQQrdZ1QQcmdZViewItem
or one of these ICs --
http://www.allelectronics.com/cgi-bin/item/EDE-702/285/LCD_CONTROLLER_IC_.html
Update:
Here's another kit, nice if you have a considerable·box-of-parts already·(IC & PCB, but other necessary components are extra) -- http://www.bgmicro.com/index.asp?PageAction=VIEWPROD&ProdID=10799
Post Edited (PJ Allen) : 5/16/2007 12:41:59 AM GMT
This is a page that has a lot of detailed info about LCDs, but all we need is the character map : http://home.iae.nl/users/pouweha/lcd/lcd0.shtml#charset
Other LCD links that might help:
http://www.electronic-engineering.ch/microchip/datasheets/datasheets.html - A lot of good information for parallel LCDS, may be helpful
http://www.geocities.com/dinceraydin/djlcdsim/djlcdsim.html - Javascript Parallel LCD simulator. (Learn what all those codes do)
Wulfden.org
I bought one of the 4x20 blue serial LCDs from the PHAnderson Electronics eBay store last summer and it works great. It's so bright you can almost use it as a night light.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick