Shop OBEX P1 Docs P2 Docs Learn Events
LCD Help — Parallax Forums

LCD Help

ineedlcdhelpineedlcdhelp Posts: 19
edited 2008-12-06 22:39 in BASIC Stamp
I got a parallax 2x16 LCD screen for use with a BS2 (Rev G) for a project. None of the sample code worked. The screen would just stay there with the cursor in the upper left and not respond to my commands. I was thinking that maybe it is a problem with the baud rate, and maybe the screen I got, or something I am using differs from the sample code. Does anyone know how I can get it working?
«1

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-01 23:21
    When I had that problem, it was because of the baud rates.

    First of all, I'm assuming that what you have is a serial LCD. Everything is very different for the parallel ones. If yours is parallel, let us know - otherwise you'll get a bunch of meaningless advice.

    The LCD should have a couple of dip switches on the back to set self test and the various baud rates. Set it to 19,200 (ON - ON). Then try this piece of code (from the docs):

    ' {$STAMP BS2}
    TxPin CON 0
    Baud19200 CON 32
    HIGH TxPin ' Set pin high to be a serial port
    PAUSE 100 ' Pause for Serial LCD to initialize
    SEROUT TxPin, Baud19200, [noparse][[/noparse]"Hello, this text will wrap."]
    



    If that doesn't work, try setting it to 9600 (OFF - ON) and change the second constant to 84 in the code and run it again. What happens?
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 00:04
    Yes, it is the serial one. And, that code does not work either, for either of the two baud rates. The cursor still stays in the left most, uppermost position and nothing happens.

    This is how everything is wired:

    +9V (Battery)----voltage regulator
    GND (Battery)----voltage regulator(GND)----screen GND
    +5V output from regulator----screen +5V
    P0----screen Rx
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-02 00:18
    Can you explain more about how the Stamp is set up? Are you using one of the standard boards (Board of Education, Homework Board, Super Carrier Board, etc.?).

    Can you confirm that you have set the DIP switches on the back?

    Also you can try moving both DIP switches to OFF and supplying +5V to the LCD (+5 and gnd connections). That should give you the standard

    "Parallax, Inc.
    www.parallax.com"

    self-test display. If that does not work, you've got a broken LCD.
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 00:38
    Yes, I tried the self test and it worked. It is a board of education Rev B. I looked at the help file for the basic stamp editor, and even tried 2400 baud rate. Nothing worked. Maybe it is a problem with the rather old board, rather then the screen?
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 01:10
    Do not take any kind of offense to what··I am saying

    Did you by· any chance hook power to the wrong pins

    The reason I ask is I did this once then after that it did the same thing

    With that type of pin connector this is very easy to do

    One more thing

    YOU MUST POWER DOWN THE LCD WHEN CHANGING THE BAUD RATE·SWITCHES

    ·for the chances to take hold.......not doing this will make the LCD not work Also


    ·Try this routine and see if this works·I used the same LCD Display· ·

    ·' {$STAMP BS2}
    ' {$PBASIC 2.5}



    LCD············ · ·PIN···· 0

    LineOne0······· ·CON···· $80
    LineTwo0······· ·CON···· $94
    ClearScreen····· CON···· $0C
    Baud············· ·CON···· 32············· ' baudmode constant for LCD Display

    DO

    SEROUT LCD, Baud, [noparse][[/noparse]lineOne0," HELLO"]
    SEROUT LCD, Baud, [noparse][[/noparse]lineTwo0," WORLD"]

    LOOP

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 12/2/2008 1:58:52 AM GMT
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-02 01:47
    I'm with sam sam sam (sam sam...). Recheck your wiring. I'll bet I've made that mistake more often than anything other than bad power supply and wrong baud rate (which are easily #1 and #2 on my personal hit parade).

    Have you tried using a different I/O pin? Move the wire to one of the higher pins, and change the constant in the program, and try that.
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 01:56
    Yes, everything is connected correctly. I even probed around with a multimeter, and everything is correct. I tested the voltage of the output from the pin, and it was 5V, which it is supposed to be, because it is set to high initially. When I run the program, I can actually see the voltage drop by 0.01V. But nothing happens on the screen. No matter what pin I use.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 01:59
    One more thing there is apot on the back of the LCD for contrast try adj that· and see if you can see any thing

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:00
    I can see the cursor
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 02:05
    Did you power down the LCD Display and power it back on

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:06
    Yep, I have repeatedly, to no avail.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 02:09
    Have you changed to a different PIN # also change the Pin # in your code to match each other

    Make sure that you power down both the Basic Stamp and the LCD display when doing this

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:11
    Yes, I already did that.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 02:13
    Are you using the LCD cable from Parallax or did you make your own

    is this on a bread board that you are doing this on


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-02 02:15
    It's a BS2, not a BS2p, BS2px or BS2sx?

    You tried a new battery?

    (sorry, but we've already gone through all of the obvious things)
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:19
    It's a BS2, it says "Rev G" on the chip as well. I will try new batteries in a second.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 02:24
    Is this a home work board· or a Basic Stamp Board· can you give us a web link to what board that you have


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:26
    Nope, Board of Education. Tried new batteries btw, didn't help.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 02:32
    Are you using the LCD cable from Parallax or did you make your own

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:33
    3pin parallax cable
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-02 02:35
    Then you need to call Parallax Tech Support and see if they can help you more with your problem

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-02 02:53
    So, no-one else has had this problem?
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-02 03:44
    Yeah, I hate to say it, but I think you're at the "call tech support" point. And they're going to ask you all the same questions we just asked, all over again.

    It sounds to me like you do know what you're doing, and you've tried the right stuff already.
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-06 02:07
    I haven't yet called tech support. I will probably email them. I connected the screen directly to my computer using a serial cable. I used the debugger in the basic stamp editor to send data to the screen. However, nothing happened. I tried different baud rates, all to no avail. Also, I connected the BS2 to my computer, and tried communicating with the computer from the BS2. I just sent a string using baud mode 16468 (9600bps) I think it was, and my computer successfully received it. So, the BS2 is outputting serial correctly. Does serout send rs232? Either that or my computer understood that 0V = low and 5V= high. But with rs232, isn't -3V high and 3V low?
  • $WMc%$WMc% Posts: 1,884
    edited 2008-12-06 02:44
    ineedlcdhelp

    coryb do You have the cable attch. to the back of the LCD rite???
    You showed 4 pins on the back of the LCD but are useing a 3 pin cable?

    ___________$WMc%_____"We arnt dune Yet"__
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-06 03:08
    No, there's only three pins on the screen. Rx, +5v, and gnd.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-12-06 05:08
    ineedlcdhelp

    coryb..Your not pluging into X4 14 or 15 with the LCD are You?

    I just set up a test demo from My sons BOE bot. with the serial LCD. It worked fine

    RX to pin 0 on $stamp header NOT X4
    Vdd to 5 volts+
    Vss to GRD.

    '{$STAMP BS2}
    TxPin CON 0
    Baud19200 CON 32

    HiIGH TxPin
    PAUSE 100

    SEROUT TXPin, Baud19200,[noparse][[/noparse]"Helo,this text will wrap."]

    ______$WMc%__Try this____
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-06 14:15
    $WMc%, you didn't solve my problem, but you made me find out what the problem was! I bought a voltage regulator to power the LCD. I connected the ground from the regulator to the ground of the screen, but didn't connect it to Vss as well. That was the problem. There wasn't a complete circuit for the serial data, because the board is powered from a separate power source. Problem solved. Thanks for posting that, since it helped me find my problem.
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-06 15:14
    Excellent! Way to go, guys!
  • ineedlcdhelpineedlcdhelp Posts: 19
    edited 2008-12-06 17:27
    Now the only problem that I'm having is that I am making an interface between the screen and the computer. I tried making a 32 byte buffer (since the screen can only display 32 chars) but I ran out of variable space! Basically, I have protocol that I made up where my computer tells the BS2 what to do. For example, display an int, display a float, display a string, backlight on, etc. So I think I am going to buy an EEPROM chip to store the characters from the computer on. The project that I am doing for school is to make it so that I can press a button on a remote control, and display up to 10 different pre-programmed messages. The trouble is, at 32bytes/string, it comes out to be 320Bytes, and I don't think there is enough variable room for that. Although the data to be displayed can be stored in the program memory, I suppose. But I'd like to have it isolated on it's own EEPROM chip. It only costs $1.55, but parallax has a minimum purchase of $10, so I may also buy another of those breadboards since the one on the BOE board is getting way cluttered, and I haven't even put the infrared phototransistor and related circuitry on it yet.
Sign In or Register to comment.