Shop OBEX P1 Docs P2 Docs Learn Events
How do I hook up an LCD? (2x16 Backlight) — Parallax Forums

How do I hook up an LCD? (2x16 Backlight)

Masterchief1517Masterchief1517 Posts: 29
edited 2009-09-13 20:00 in BASIC Stamp
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?
«1

Comments

  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-13 20:16
    Hold up, I do infact have the backlit LCD, BUT it doesn't have the controller on the back of it, so the "pins" on the top of the chip have nothing soldered to them, how can I hook this up to a basic stamp or picaxe?

    Post Edited (Masterchief1517) : 5/13/2007 8:39:04 PM GMT
  • ForrestForrest Posts: 1,341
    edited 2007-05-14 00:09
    It sound like you have a parallel HD44780 based LCD. Yes, you can hook this up to a Basic Stamp - this question pops up every other week on this board. Check the manual to the Parallax parallal LCd here www.parallax.com/detail.asp?product_id=603-00006 or google Stamp to parallel LCD, there's lot of info.
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-14 03:09
    No, I don't have that, it has no cable attached to it like that, and it has the exact same build as the serial 2 x 16 except there just isn't any controller on / with it. *EDIT* I did some googling, I discovered this is made by some chinese company or something like that, BUT it has the same dimensions as the backlit 2 x 16 parallax screen.

    Post Edited (Masterchief1517) : 5/14/2007 3:29:21 AM GMT
    640 x 480 - 69K
    640 x 480 - 46K
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-14 03:38
    From the label on the back, it does look similar (as Forrest said) to the Parallax parallel LCD. Follow his suggestions and you'll just have to experiment (and add your own cable).
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-14 03:42
    Okay... I'll check out some things... But if I have no luck, my voice (hypethetically) will speak tomorrow!
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-14 04:00
    Okay, well I'll be using a BOE with a BS2 chip, so, assuming this is just like the parallel 2 x 16 screen, could someone explain to me how exactly to wire this up, preferrably in 8 bit mode, because there is a diagram a kinda already understand for 4 bit mode.
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-14 16:53
    Does anyone know which pin to wire each of these to? VSS(duh), VDD(duh), V0, RS, R/W, E, D0, D1, D2, D3, D4, D5, D6, D7.
  • WynandWynand Posts: 39
    edited 2007-05-14 17:43
    Masterchief1517,

    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
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-14 19:50
    I could gives you a thousand dollars for that help there, but unfortunately, I don't have a thousand to give away·turn.gif· But when I bought this off ebay, I thought I was buying a serial screen, oh well, time to heat up the soldering iron!
  • WynandWynand Posts: 39
    edited 2007-05-14 19:57
    Masterchief1517,

    If you get it working, let us know.....

    And good luck.....

    Wynand.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Why didn't I think of THAT!!!!
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-14 21:17
    Okay I think it is wired up correctly now, I used the source code from the site, I hope that wasn't a mistake, cause now when it boots, the backlight turns on(good), but the "text" is just the top row being filled with dark boxes. I noticed a part of the code that says "set to 4-bit operation" This is wired in 8-bit I believe, so shouldn't it be starting in 8 bit? If so, how do I do that? Here is that entire subroutine: 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
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-15 00:58
    Quick clarification here, where is says "OUTS = %00100000 'Set To 4-bit Operation" , I was wondering what value you would you to set it to 8-bit mode?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-15 02:05
    Since you aren’t using 4-bit mode you simply omit that line along with its GOSUB call. By the way, the attached (above) datasheet covers the initialization sequences. They’re listed right in there for both 4-bit and 8-bit modes. See page 45. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-15 02:07
    Oh, sorry about that, thanks a bunch, I got just about sick of reading that thing around page 35, lol.
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-15 02:30
    Ummm, what is the normal sign that your lcd is dead (by wiring it wrong) Can your program destroy your lcd (by telling it to send something through the wrong pin) Cause when mine starts up, it just shows the top line being covered with blocks, and it won't go away, I made sure it wasn't the program either by unplugging the data cables

    Post Edited (Masterchief1517) : 5/15/2007 2:36:02 AM GMT
  • ForrestForrest Posts: 1,341
    edited 2007-05-15 03:35
    Do you have the wiper of a 10K pot connected to pin 3 (Vo) on your LCD? Try adjusting the pot.
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-15 03:39
    I'm not using a pot, cause I was told hooking right to ground was fine, should i hook a 10k resistor to it? I could wire up other resistors to make it between 10k and 20k.
  • WynandWynand Posts: 39
    edited 2007-05-15 05:40
    The black boxes accross the top line means that the lcd has power, but has not recieved initialization, ie has not revieced the turn of/turn on, clear screen instruction.
    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!!!!
  • WynandWynand Posts: 39
    edited 2007-05-15 08:00
    Ok, so I have done some thinking, and tweeked the demo program.

    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
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-15 16:48
    Not quite, but I did add a 10k resistor and that got rid of the blocks.... Nothing else came up on the screen, I'll run the default program again, with the right I/O set.
  • Lmiller1708Lmiller1708 Posts: 12
    edited 2007-05-15 17:05
    Hello,
    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
  • WynandWynand Posts: 39
    edited 2007-05-15 18:43
    I just hope that you didn't set the contrast so low that the block dissapear,meaning nothing else on the lcd will display. I have exactly the same lcd connected to the parallel port of my pc, and when I start it up, black blocks, but as soon as the program starts to send it info, bob is your uncle and it displays everything as it should. Look, by no means do I sell myself out as an expert, I jst think that we have the pin-outs wrong, so it is a matter of programming and logic thinking...................still thinking.........................still thinking............................pleased help me people!!!!!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Why didn't I think of THAT!!!!
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-16 00:10
    Well, either way, with your program and no resitor, just blocks, your program and 10k or 4.7k resistor: no blocks, no text. If anyone here has a serial lcd, they can tell me all the parts I'd need to get to build the "backpack" which I could then attach it to the screen and wire in serial!
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-16 00:19
    Isn't serial mode just telling another chip, which is wired in parallel to the LCD, what character to send next?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-05-16 00:27
    The serial backpack is an interface which takes serial data from a Stamp and converts/performs all of the memory-gobbling house-keeping and choring·(i.e. all of the "code" required to run an LCD directly.)· Anyway, it's a micro-controller in itself, actually.· If you don't want to buy a Parallax serial LCD (tsk-tsk), you could order one of these kits (they're very good) --

    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
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-16 01:20
    HOLY $&!^!!!!! I got it partially working, I wired it up for 4 bit mode, now there is just 1 box on the far left, and the '&' symbol on the bottom right!
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-16 01:35
    I have a picture of this ... funky... text
    2592 x 1944 - 751K
  • firestorm.v1firestorm.v1 Posts: 94
    edited 2007-05-16 02:06
    The LCD is in "chinese mode", Check a pin, I think you got a bad connection somewhere. The Chinese and English character sets are offset by only a couple of pins, if one is shorted, then both might register as high. As a suggestion, if you're bored (AND you've checked our connectors) each of those characters refers to a 8 bit word, Use the character map to find what those characters represent, then you should see the common pins to take a look at. What were you trying to get the LCD to say? It might not be a bad idea to do the same for what you were expecting the LCD to say, so that way you can see which pins are working and which aren't.

    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)
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-05-16 22:58
    In addition to PJ Allen's links, here is another source for the Peter Anderson serial kit:

    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
  • Masterchief1517Masterchief1517 Posts: 29
    edited 2007-05-17 02:20
    yeah, I saw that site yesterday, but the k107 page wan't working right at the time :-(, but now it is, so thanks! I'm digging around fo rthe cheapest board I can find.
Sign In or Register to comment.