Shop OBEX P1 Docs P2 Docs Learn Events
2x16 Parallel LCD - Not working? — Parallax Forums

2x16 Parallel LCD - Not working?

everesteverest Posts: 141
edited 2010-05-11 12:35 in BASIC Stamp
I now have TWO 2x16 stock LCDs from Parallax. I've tried connecting both of them directly to the dedicated LCD connection on my professional development board, and connecting all three pins as indicated in the sample code for the LCD. . .and I see absolutely nothing on my LCDs. . .zippo. . .am I just missing something fundamental here???? Strange for something right out of the box on a dedicated development board all from the same manufacturer, with their own code to just not work. I suspect a bonehead move on my part!

-Jeff

Comments

  • WolfbrotherWolfbrother Posts: 129
    edited 2009-08-25 17:26
    Hi,

    Did you set the serial rate with the two switches on the back of the LCD? There's also a pot on the back of the LCDs and it adjusts the contrast. Check that adjustment as well.
  • SRLMSRLM Posts: 5,045
    edited 2009-08-25 18:13
    @Wolfbrother

    I don't have the parallel version (which I assume everest is talking about), but it appears that the baud isn't selectable. I think you're thinking of the serial LCD

    @everest
    Assuming that you're talking about the parallel LCD, according to the LCD datasheet you need to dedicate 7 I/O pins for four bit mode, which is what the sample code does. Have you used jumpers to connect all 7 pins?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-25 18:33
    Make sure the contrast potentiometer (near X1) is set properly. It may be that the LCD is working invisibly with no contrast.
  • everesteverest Posts: 141
    edited 2009-08-26 16:56
    Thanks for the replies! I'm specifically referring to item # 603-00006, the Parallel LCD. I've tried the various adjustments (contrast, etc.) but I'll check again tonight just to be sure. Looking at the code, it looks to me like the unit is only using 3 pins (0, 2, and 3). I've pasted the code from Parallax below. . .it's just super simple. I'm using the recommended professional development board, which has a built in socket for the LCD, and then I've connected pins 0, 2, and 3 to the E, RW, and RS pins. . .

    The program runs fine, but neither LCD does a darn thing. . . .

    -Jeff


    ' =========================================================================
    ' File...... Parallel_LCD_2X16.bs2
    ' Purpose... Parallel LCD Display Demo
    ' Author.... Parallax, Inc.
    ' E-mail.... support@parallax.com
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '
    [noparse][[/noparse] Program Description ]
    ' This program demonstrates using a Hitachi-compatible Parallel LCD Display
    ' This code works with the BS2, BS2e and BS2sx
    '
    [noparse][[/noparse] I/O Definitions ]
    E PIN 0 ' Enable Pin For LCD
    RW PIN 2 ' R/W Pin For LCD
    RS PIN 3 ' LCD Register Select
    ' 0 = Instruction, 1 = Text
    '
    [noparse][[/noparse] Variables ]
    char VAR Byte ' Character To Send To LCD
    inst VAR char ' Induction To Send To LCD
    index VAR Word ' Character Pointer
    temp VAR Byte ' Temp Variable
    '
    [noparse][[/noparse] EEPROM Data ]
    DATA "Hello, this is the LCD demo." ' Message To Send To LCD
    '
    [noparse][[/noparse] Initialization ]
    Initialize:
    LOW RW ' Set LCD To Write Mode
    OUTS = %0000000000000000 ' Set All Output Low
    DIRS = %0000000011111111 ' Set I/O Direction
    GOSUB Init_Lcd ' Initialize The LCD Display
    '
    [noparse][[/noparse] Program Code ]
    Main:
    FOR temp = 0 TO 27 ' 28 Characters
    IF temp = 15 THEN ' Check For End Of Line
    GOSUB Next_Line ' Jump To Next Line
    ENDIF
    READ temp, char ' Read Next Character From EEPROM
    GOSUB Send_Text ' Send Character To LCD Display
    NEXT
    END
    '
    [noparse][[/noparse] Subroutines ]
    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
    Send_Inst:
    LOW RS ' Set Instruction Mode
    OUTB = Inst.HIGHNIB ' Send High Nibble
    PULSOUT E,1
    OUTB = Inst.LOWNIB ' Send Low Nibble
    PULSOUT E,1
    HIGH RS ' Set LCD Back To Text Mode
    RETURN
    Send_Text:
    OUTB = Char.HIGHNIB ' Send High Nibble
    PULSOUT E,1
    OUTB = char.LOWNIB ' Send Low Nibble
    PULSOUT E,1
    PAUSE 100
    RETURN
    Next_Line:
    Inst = 128+64 ' Move Cursor To Line 2
    GOSUB Send_Inst
    RETURN
  • SRLMSRLM Posts: 5,045
    edited 2009-08-26 18:14
    Those three pins are just the ones named. It's not a requirement that pins be named, and indeed, the code appears to use eight pins. Specifically, look at lines like this:

    OUTS = %00100000 ' Set To 4-bit Operation
    
  • everesteverest Posts: 141
    edited 2009-08-27 22:24
    Ahh, thanks. . .I had to dig like *crazy* to come up with info on the OUTS, DIRS, etc commands. They don't appear in the command references in my editor, but I found some good references. I'll read up on those. Thanks!

    -Jeff
  • rixterrixter Posts: 95
    edited 2009-09-02 03:05
    Everest,

    If you have the socket on your PD board for the connector, you wouldn't need to be connecting anything else to any pins on the BS as the E, RS and RW are included in the pins on the connector. Not sure if this is compounding your issue. Using the PDB socket or connecting to BS pins directly is an either-or thing. Actually, I'm not sure how you would have been able to do that anyway. Isn't the ribbon cable occupying any connections that the LCD has on it's rear? Or are you saying that you tried two different ways to hook it up.. once with the connector and once just using those three pins? I don't have a PDB, but hooking that LCD unit to the LCD connector should be using Stamp pins 0,2,3,4,5,6, & 7 in 4 bit mode, so you shouldn't be using those pins on the Stamp elsewhere for other purposes.

    Rick
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-09-02 16:45
    If your LCD modules are Hitachi compatible, and most are, they will run internal reset on power up. That is why you have 200 ms pause before the LCD initialization starts.
    Put STOP after this 200 ms PAUSE.
    Now you should be able to use the contrast adjustment to see the dots of the matrix characters. If you do not see any display at all you are probably missing the power connection.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-09-04 20:28
    The code (and the LCD) actually requires 7 I/O lines (6 if you never need to read data back). Four are used for the 4-bit data D4-D7. The other three are the control lines like Enable, R/W and RS. R/W could be tied low in many applications to free up a pin. But if you change the pins being used you need to be aware of how that affects the code and what needs to be changed. Take care.

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

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • blablablablablabla Posts: 3
    edited 2009-10-29 13:47
    hello,



    i got the same problem as everest·has got

    i connected a HD44780 lcd display to a basic stamp2, but i didnt connect it·the way it says in the example.

    i connected it like this :



    LCD pin······· |·· BS2· pin

    1···················· 23

    2···················· 21

    3···················· POT

    4······················5

    5····················· 20

    6······················19

    7····················· 23

    8······················23

    9····················· 23

    10···················· 23

    11···················· 6

    12····················· 7

    13······················ 8

    14···················· 9

    please help me, searched already on google , but i couldn´t find anything
  • blablablablablabla Posts: 3
    edited 2009-10-29 13:48
    edit:

    at the moment·the display shows· one line of blocks

    Post Edited (blablabla) : 10/29/2009 2:00:38 PM GMT
  • blablablablablabla Posts: 3
    edited 2009-10-30 12:52
    ok, now it is working proparly, but i dont know how to add a home-made character (made with the charater generator from parallax)

    p.s.: sorry for my bad english, but im from germany
  • underworldmanunderworldman Posts: 22
    edited 2010-05-10 19:39
    blablabla?

    What did you do? My parallel lcd is behaving in the exact same way. Were there any faults in your program or was it a connection issue? Please help me.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-05-11 12:35
     ' -----[noparse][[/noparse] EEPROM Data ]-----------------------------------------------------
    CC0             DATA    LcdCC0, $10, $10, $10, $10, $10, $10, $10, $10 '[color=red] <<<<<........Here is where you put your homemadecharacter[/color]   CC1             DATA    LcdCC1, $18, $18, $18, $18, $18, $18, $18, $18 ' [color=red]<<<<<........(made with the charater >[/color]  
    CC2             DATA    LcdCC2, $1C, $1C, $1C, $1C, $1C, $1C, $1C, $1C ' [color=red]<<<<<........                    > generator from parallax)
    [/color]CC3             DATA    LcdCC3, $1E, $1E, $1E, $1E, $1E, $1E, $1E, $1E
    CC4             DATA    LcdCC4, $1F, $1F, $1F, $1F, $1F, $1F, $1F, $1F
    
    ' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
      HIGH LCD                              ' Setup Serial Output Pin
      PAUSE 100                             ' Give LCD Time To Settle
    Download_Chars:
      FOR index = 0 TO 45                   ' Download Custom Characters [color=red]this # need to be adj for the  Characters you have 
    [/color]    READ CC0 + index, work              ' Read EEPROM Data
        SEROUT LCD, Baud, [noparse][[/noparse]work]            ' Send To LCD CGRAM
      NEXT
      SEROUT LCD, Baud, [noparse][[/noparse]LcdOn1, LcdBLon]   ' Turn LCD Display & Backlight On
                                            ' Backlight Only On Backlit Models
      PAUSE 10                              ' Allow LCD Time To Settle
    

    Or you use this
     ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
     
    TxPin        CON       15
    Baud19200    CON       32
     
    
    SEROUT TxPin, Baud19200, [noparse][[/noparse]2]
     
    HIGH TxPIN                            ' Set pin high to be a serial port
    PAUSE 100                             ' Pause for Serial LCD to initialize
    SEROUT TxPin, Baud19200, [noparse][[/noparse]250]        ' Define custom character 2
    
                                          ' Now send the eight data bytes
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%00000]     ' %00000 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%00100]     ' %00100 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%01110]     ' %01110 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%11111]     ' %11111 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%01110]     ' %01110 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%11011]     ' %00100 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%00000]     ' %00000 
    SEROUT TxPin, Baud19200, [noparse][[/noparse]%00000]     ' %00000 
    'SEROUT TxPin, Baud19200, [noparse][[/noparse]2]          ' Display the new custom character 2
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·Now wanting to learn Spin· Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 5/11/2010 12:50:37 PM GMT
Sign In or Register to comment.