Shop OBEX P1 Docs P2 Docs Learn Events
How to "talk" to LCD's without serial input — Parallax Forums

How to "talk" to LCD's without serial input

JimGJimG Posts: 84
edited 2006-10-11 19:14 in BASIC Stamp
I have gotten some LCD's with a fairly standard (so I am have come to understand) pinout.· I don't know a thing about these but have learned that the ones Parallax sells are similar except they have a daughter-board on them allowing for serial input.· The device I have requires input using 16 pins.· the last 2 are for the backlight so I have 14 pins to work with.· It *looks* like you·send a bit map of 8 digits to the device to tell it what character to display.· That's fine, I think I can do that.· I just want to be sure of what I am doing before I make this thing smoke.· Can someone hlep me with it.· The data sheet is below.

Here is the data sheet:· http://www.pacificdisplay.com/cdm/CDM-20400.pdf



Jim

Comments

  • ForrestForrest Posts: 1,341
    edited 2006-09-24 05:24
    If you google 'parallel LCD Stamp circuit' you'll get a lot of hit. Here's one way to connect it www.parallax.com/detail.asp?product_id=603-00006

    If you want to save some pins, here's a serial backpack that will reduce your Basic Stamp Pin count to 1 pin for around $10 from here
    www.wulfden.org/k107/index.shtml or here
    www.bgmicro.com/ - search for KIT1028
  • JimGJimG Posts: 84
    edited 2006-09-27 07:13
    Thank you ! Thank you! Thank you! This should be enough to get me started. I have seen several daughter boards for LCD's but wanted to make it work without the board first.
  • JimGJimG Posts: 84
    edited 2006-10-11 17:15
    Forrest,

    I have fiddled around with this LCD until I am more confused than wjen I started!·

    First, I am having a terrible time understanding how to send the codes to the device.· I have attached a small program loosely based on the sample provide for the 2 x 16 Parallel LCD (#603-00006) unit that Parallax sells.·

    My LCD is a 4 x 20.· I am able to send the data to the display but do not get the information in the correct locations.· When I run the attached·program it displays line 1, then line 2 then skips to line 3, displays teh line 3 text on line 4 then skips back·and overwrites line 2 with the line 4 text.· How do I code this to get to the correct lines?· I am guessing it has something to the with the statement: Inst = 128+64 ' Move Cursor To Line 2 .· The actual text it displays is correct, albeit, not wrapping perfectly, but I think I can fix that if I can just understand how to get the text on the correct line.

    As you can see from the various chunks of rem'ed out code I have tried a lot of different things.· One issue may be in the initial configuration of the LCD.·

    I have also uploaded the info about the LCD controller that is on the LCD I have.

    I realize that I can get drivers for these things that bring it down to a 3 wire serial connection but I really want to understand how they work raw before I cloud it with a serial daughter board.· In reality, I will probably use an LCD with a serial driver to save pins.

    I'd sure appreciate any help you or anyone else can give me.

    Jim
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-10-11 18:13
    JimG said...
    Forrest,

    I have fiddled around with this LCD until I am more confused than wjen I started!

    First, I am having a terrible time understanding how to send the codes to the device. I have attached a small program loosely based on the sample provide for the 2 x 16 Parallel LCD (#603-00006) unit that Parallax sells.

    My LCD is a 4 x 20. I am able to send the data to the display but do not get the information in the correct locations. When I run the attached program it displays line 1, then line 2 then skips to line 3, displays teh line 3 text on line 4 then skips back and overwrites line 2 with the line 4 text. How do I code this to get to the correct lines? I am guessing it has something to the with the statement: Inst = 128+64 ' Move Cursor To Line 2 . The actual text it displays is correct, albeit, not wrapping perfectly, but I think I can fix that if I can just understand how to get the text on the correct line.

    As you can see from the various chunks of rem'ed out code I have tried a lot of different things. One issue may be in the initial configuration of the LCD.

    I have also uploaded the info about the LCD controller that is on the LCD I have.

    I realize that I can get drivers for these things that bring it down to a 3 wire serial connection but I really want to understand how they work raw before I cloud it with a serial daughter board. In reality, I will probably use an LCD with a serial driver to save pins.

    I'd sure appreciate any help you or anyone else can give me.

    Jim

    I have been playing with several different LCD displays this past week or so and although I have full respect for the challenge of figuring things out, you will save yourself tons of time by using one of the suggested serial adapters. It won't CLOUD the issue - it will CLEAR the clouds!

    I am using two different boards, but they both use the PHAnderson PIC driver chips. One is the full LCD #115 kit, sold directly by Dr. Anderson and the other is the Brian Riley board ( www.wulfden.org/k107/index.shtml ) which uses Dr. Anderson's LCD 117 chip. The latter has become my preferred "backpack" - simple 3 wire (+5, GND, Data) interface and very straightforward to program.

    Using this board has allowed me to move on with my project with the display portion completely implemented.
  • JimGJimG Posts: 84
    edited 2006-10-11 18:25
    Paul,

    I have one of Riley's complete kits on order. I already have one of his daughter boards but it doesn't seem to want to work with the LCD I have.

    I still want to understand how to address the LCD directly without the serial interface. A lot of what I am trying to accomplish has more to do with learning than the finished product so gettting to the details is kind of important.

    Jim
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-10-11 18:31
    JimG said...
    Paul,

    I have one of Riley's complete kits on order. I already have one of his daughter boards but it doesn't seem to want to work with the LCD I have.

    I still want to understand how to address the LCD directly without the serial interface. A lot of what I am trying to accomplish has more to do with learning than the finished product so gettting to the details is kind of important.

    Jim

    I fully understand - solving challenges are the best learning tools!

    Check around PHAnderson's site - he has some schematics there that might shed some light for you.

    Good luck!

    Paul
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-10-11 18:46
    JimG said...
    Forrest,

    My LCD is a 4 x 20. I am able to send the data to the display but do not get the information in the correct locations. When I run the attached program it displays line 1, then line 2 then skips to line 3, displays teh line 3 text on line 4 then skips back and overwrites line 2 with the line 4 text. How do I code this to get to the correct lines? I am guessing it has something to the with the statement: Inst = 128+64 ' Move Cursor To Line 2 . The actual text it displays is correct, albeit, not wrapping perfectly, but I think I can fix that if I can just understand how to get the text on the correct line.

    Jim

    Jim,

    I just read through this again and had to chuckle - this is exactly what I experienced on my first try and was also bewildered.

    Turns out, this behavior is precisely how the display SHOULD act if you use sequential indexing to move your cursor. If you read the datasheet (the one you supplied!), page 13 on the bottom has the "LCD Character Location Map" - which is your answer! When you use direct cursor position addresses, you will handle this mapping yourself.

    You may be closer than you think!!

    Paul
  • JimGJimG Posts: 84
    edited 2006-10-11 19:02
    Paul,

    You have identified EXACTLY my problem except I don't understand how to do what I need to do. I have read the data sheet(s) until I am sore. I have looked at schematics with the same end result. The light just won't go on. Can you maybe give me a couple hundred (or so) examples. smile.gif

    Something like:
    send this command and this happens

    If you can get me started I think I can figure it out from there, I just can't get a toe hold.

    Jim
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-10-11 19:14
    JimG said...
    Paul,

    You have identified EXACTLY my problem except I don't understand how to do what I need to do. I have read the data sheet(s) until I am sore. I have looked at schematics with the same end result. The light just won't go on. Can you maybe give me a couple hundred (or so) examples. smile.gif

    Something like:
    send this command and this happens

    If you can get me started I think I can figure it out from there, I just can't get a toe hold.

    Jim

    Well, like I said, I quickly went to the SERIAL solution, but I'll give it a try.

    The first things I would do are 1) work with a short string such as "Test Line". 2) Get rid of the FOR...NEXT loop and work on putting the short string where YOU want it. One of the things I discovered was that what I THOUGHT I was sending as commands weren't in the correct representation (HEX, DEC, etc..) for the display.

    Once you figure out how to place the short string, I believe everything should fall into place. Sorry I can't offer more, but I bailed on the Parallel interfacing!! Anderson and Riley made it TOO easy!
Sign In or Register to comment.