Shop OBEX P1 Docs P2 Docs Learn Events
Parallel LCD problem with BS2p — Parallax Forums

Parallel LCD problem with BS2p

LloydsLloyds Posts: 75
edited 2010-08-29 20:22 in BASIC Stamp
Hi,
I recently got a new BS2p40 and have wired up the Parallax parallel display (2x16) with the 14 pin ribbon cable per the documentation for the display (connects to pins P0,2,3,4,5,6,7, with 10k resistors, etc.) I downloaded the demo prog for the BS2p and all I get is a single line of 16 blocks. I saw this problem mentioned in the past but haven't seen where anybody has said exactly what they did to fix it.

Anybody have a suggestion?

Thanks,
Lloyd

Comments

  • LloydsLloyds Posts: 75
    edited 2010-07-05 21:53
    Hmm.... Now I see that the schematic for hooking up the display that you get to via the Parallax Store documentation is different from the schematic that is in the LCDCMD reference in the syntax and reference manual. I used the schematic from the store documentation. Did a pretty neat job too.
    Lloyd
  • LloydsLloyds Posts: 75
    edited 2010-07-06 11:33
    I re-wired it to match the other schematic and it works the same - a single line of solid blocks.
    The display comes connectorized with pin one identified with a red wire. I must be missing something. The contrast control works fine, if that is an indication of anything.
    Here is the code I am using.
    Any ideas?

    Any ideas?
    Thanks,
    Lloyd

    ' =========================================================================
    ' File...... Parallel_LCD_2X16.bsp
    ' Purpose... Parallel LCD Display Demo
    ' Author.... Parallax, Inc.
    ' E-mail.... support@parallax.com
    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}
    '
    [noparse][[/noparse] Program Description ]
    ' This program demonstrates using a Hitachi-compatible Parallel LCD Display
    ' This code works with the BS2p24, BS2p40, BS2pe and BS2px24
    '
    [noparse][[/noparse] I/O Definitions ]
    Lcd PIN 0 ' LCD Enable Pin
    '
    [noparse][[/noparse] Variables ]
    temp VAR Byte
    char VAR Byte
    '
    [noparse][[/noparse] Initialization ]
    Init_Lcd:
    PAUSE 1000
    FOR temp = 0 TO 2
    LCDCMD Lcd, 48 ' Reset LCD (Send 3 times)
    PAUSE 5 ' Delay Require By LCD Specs
    NEXT
    LCDCMD Lcd, 32 ' Set 4-bit Mode
    LCDCMD Lcd, 40 ' Set 2-line Mode
    LCDCMD Lcd, 12 ' Turn On Display With No Cursor
    LCDCMD Lcd, 6 ' Set To Auto-Increment Cursor
    LCDCMD Lcd, 1 ' Clear Display
    '
    [noparse][[/noparse] Main Routine ]
    Main:
    DO
    LCDOUT Lcd, 1, [noparse][[/noparse]"Hello, this is"] ' Clear LCD & Print Line 1 Text
    LCDOUT Lcd, 192, [noparse][[/noparse]"the LCD demo."] ' Move To Line 2 & Print Text
    PAUSE 3000 ' Wait A Few Seconds
    LCDCMD Lcd, 1 ' Clear LCD
    PAUSE 500 ' Wait 1/2 Second
    LOOP ' Do It Again
    END
  • Pressus LimitedPressus Limited Posts: 23
    edited 2010-07-06 13:55
    Hi Lloyd,

    it could simply be your init_lcd routine, you're using a for-next routine which is placing a 5ms delay between each command. If you look at the sample code on page 251 of manual, it's 5 ms for the first command and then 0ms for the next 2.

    Jon
  • LloydsLloyds Posts: 75
    edited 2010-07-06 14:52
    Jon,
    I actually also tried the program on page 255 which has the 5,0,0 msec pauses, and the result was the same.
    Thanks for the suggestion, though.

    If the contrast control works, I'm guessing that the wiring is at least not totally wrong.
    I'm still stumped, but your suggestion of a problem with the init routine sounds probable.
    Lloyd
  • Pressus LimitedPressus Limited Posts: 23
    edited 2010-07-06 15:10
    I use the 4x20 LCD's and use 10,1,1 msec pauses which works great.

    Are you sure it's not something silly like the Data lines not wired in reverse... or even on the wrong pins - you haven't got a LCD with backlight have you, which has 2 extra pins 15 & 16, and you have inadvertently wired the data lines to the backlight pins?

    Jon
  • LloydsLloyds Posts: 75
    edited 2010-07-06 18:15
    I'm pretty sure I have it wired correctly. The display came with a ribbon cable attached & a 2x7 connector. I made a little adapter board that the ribbon cable plugs into, and then the adapter card plugs into the BS2p pins 0,2,3,4,5,6,7. The adapter board also has the 5 resistors and the contrast pot for the display.

    I will double check everything tonight and play with the Initialization settings.

    Lloyd
  • LloydsLloyds Posts: 75
    edited 2010-07-07 02:13
    "Are you sure it's not something silly like".....
    Like not hooking up the enable connection??? LOL
    Nothing like like buzzing the circuit out one last time even though you are POSITIVE its correct.
    Thanks,
    Lloyd
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-07-07 19:22
    So it is working now then?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • LloydsLloyds Posts: 75
    edited 2010-07-07 22:04
    Yes, Like a charm ! I ended up wiring it like the schematic in the LCDCMD section in the Syntax and ref manual, but the root of the problem was my totally missing the enable connection. Once I soldered in that wire the problem was gone.
    I'll use a little more care in buzzing things out next time.
    Lloyd
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-07-08 18:28
    Glad to hear you got it working. Take care. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • Amish EngineerAmish Engineer Posts: 4
    edited 2010-08-28 23:18
    Hi,
    I have a similar problem, but the first 8 blocks in the first and second rows are solid. I guess this is just the test pattern for this particular LCD.

    I wired up the LCD to my BSII per this tutorial

    http://www.parallax.com/dl/docs/prod/audiovis/lcd2x16par.pdf

    I copied the code for the BSII and downloaded it, but nothing works. It's like it isn't even connected, but it is! The backlight works, the contrast works, but I just get a test pattern. I left everything hooked up, downloaded a simple led flash code and wired up an LED to see if my stamp wasn't dead. It worked fine. Last I pulled the stamp out of the board, and the LCD screen still stays the same. Clearly, the BSII isn't communicating with the LCD, but all my wires are there, so I don't know what to think.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-29 11:56
    The original poster swore up and down how he'd done everything right and nothing wrong and everyone was wasting his time by urging him to check his wiring. And it turned out to be his wiring.

    Check your wiring.
  • LloydsLloyds Posts: 75
    edited 2010-08-29 13:03
    Yup, I now have 3 different LCD displays working with p40s and I had initial wiring errors in 2 of the 3. (I know I'm not the only one.) There are a bunch of different schematics around for wiring these displays and the one I used is on page 250 of the syntax and ref manual download. It's different than the one you referenced, but I imagine they will both work.
    Lloyd
  • Amish EngineerAmish Engineer Posts: 4
    edited 2010-08-29 20:22
    I've checked my wiring several times. I grounded the R/W pin as well, to make sure the that wasn't an issue.

    That other program/schematic is for a bs2p, so it won't work.
    If I can't get it running, oh well. My actual projects use AVRs; I just like testing new components that take some time to set up with my basic stamp, instead of writing an actual program. I'll get around to it someday.
Sign In or Register to comment.