Shop OBEX P1 Docs P2 Docs Learn Events
Need help with StampWorks LCD — Parallax Forums

Need help with StampWorks LCD

moo2moo2 Posts: 17
edited 2007-09-26 02:20 in BASIC Stamp
Hi All.
I need help with the LCD that came with my StampWorks kit.

No matter what I do, I cn't get anything to display on the LCD. I connected the LCD to the PDB as instructed (there's only one way to do this). Then, I loaded the source for the LCD Demo program. The LCD doesn't show anything at all. If I turn the contrast all the way up, I can see 16 black square "cursor" characters on the upper line of the LCD, and nothing on the bottom. I tried entering the code by hand, but the result was the same. I triple checked the connections, but I can't find anything wrong.

Is there any way to see if it's the PDB that's the problem, or the LCD? Also, the StampWorks book says that the LCD needs 220 Ohm resistors on the IO lines, but the LCD documentation that's on the CD says they need 10KOhm resistors. That's quite a big difference. I'm not sure which number is correct, but I hope the ones built on to the PDB are correct.

The main reason I bought the Stampworks kit was because it included the LCD, so this is quite disappointing.

Comments

  • dandreaedandreae Posts: 1,375
    edited 2007-09-20 17:35
    The LCD doesn't require any additional resistors.· What REV·of the PDB do you have?· Can you send me the code that you are using?· You can send it to dandreae@parallax.com.

    Regards,

    Dave





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • moo2moo2 Posts: 17
    edited 2007-09-21 02:09
    Thanks for the help.
    The PDB is Rev D

    Here is the code I'm using:
    ' =========================================================================
    
    '
    
    '   File....... SW21-EX11-LCD_Demo.BS2
    
    '   Purpose.... Essential LCD control
    
    '   Author..... (C) 2000 - 2005, Parallax, Inc.
    
    '   E-mail..... support@parallax.com
    
    '   Started....
    
    '   Updated.... 15 AUG 2006
    
    '
    
    '   {$STAMP BS2}
    
    '   {$PBASIC 2.5}
    
    '
    
    ' =========================================================================
    
    
    
    
    
    ' -----[noparse][[/noparse] Program Description ]---------------------------------------------
    
    '
    
    ' This program demonstrates essential character LCD control.
    
    '
    
    ' The connections for this program conform to the BS2p-family LCDCMD,
    
    ' LCDIN, and LCDOUT instructions.  Use this program for the BS2, BS2e,
    
    ' or BS2sx.  There is a separate program for the BS2p, BS2pe, and BS2px.
    
    
    
    
    
    ' -----[noparse][[/noparse] I/O Definitions ]-------------------------------------------------
    
    
    
    E               PIN     1                       ' Enable pin
    
    RW              PIN     2                       ' Read/Write
    
    RS              CON     3                       ' Register Select
    
    LcdBus          VAR     OUTB                    ' 4-bit LCD data bus
    
    
    
    
    
    ' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
    
    
    
    LcdCls          CON     $01                     ' clear the LCD
    
    LcdHome         CON     $02                     ' move cursor home
    
    LcdCrsrL        CON     $10                     ' move cursor left
    
    LcdCrsrR        CON     $14                     ' move cursor right
    
    LcdDispL        CON     $18                     ' shift chars left
    
    LcdDispR        CON     $1C                     ' shift chars right
    
    
    
    LcdDDRam        CON     $80                     ' Display Data RAM control
    
    LcdCGRam        CON     $40                     ' Character Generator RAM
    
    LcdLine1        CON     $80                     ' DDRAM address of line 1
    
    LcdLine2        CON     $C0                     ' DDRAM address of line 2
    
    
    
    
    
    #DEFINE _LcdReady = ($STAMP >= BS2P)
    
    
    
    
    
    ' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
    
    
    
    char            VAR     Byte                    ' character sent to LCD
    
    idx             VAR     Byte                    ' loop counter
    
    
    
    
    
    ' -----[noparse][[/noparse] EEPROM Data ]-----------------------------------------------------
    
    
    
    Msg             DATA    "The BASIC STAMP!", 0   ' store message
    
    
    
    
    
    ' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
    
    
    
    Check_Stamp:
    
      #IF (_LcdReady) #THEN
    
        #ERROR "Please use BS2p version: SW21-EX11-LCD_Demo.BSP"
    
      #ENDIF
    
    
    
      DIRL = %11111110                              ' setup pins for LCD
    
      PAUSE 100                                     ' let the LCD settle
    
    
    
    Lcd_Setup:
    
      LcdBus = %0011                                ' 8-bit mode
    
      PULSOUT E, 3
    
      PAUSE 5
    
      PULSOUT E, 3
    
      PULSOUT E, 3
    
      LcdBus = %0010                                ' 4-bit mode
    
      PULSOUT E, 1
    
      char = %00001100                              ' on, no crsr, no blink
    
      GOSUB LCD_Cmd
    
      char = %00000110                              ' inc crsr, no disp shift
    
      GOSUB LCD_Cmd
    
    
    
    
    
    ' -----[noparse][[/noparse] Program Code ]----------------------------------------------------
    
    
    
    Main:
    
      char = LcdCls                                 ' clear the LCD
    
      GOSUB LCD_Cmd
    
      PAUSE 500
    
      idx = Msg                                     ' get EE address of message
    
    
    
    Write_Message:
    
      DO
    
        READ idx, char                              ' get character from EE
    
        IF (char = 0) THEN EXIT                     ' if 0, message is complete
    
        GOSUB LCD_Out                               ' write the character
    
        idx = idx + 1                               ' point to next character
    
      LOOP
    
      PAUSE 2000                                    ' wait 2 seconds
    
    
    
    Cursor_Demo:
    
      char = LcdHome                                ' move the cursor home
    
      GOSUB LCD_Cmd
    
      char = %00001110                              ' turn the cursor on
    
      GOSUB LCD_Cmd
    
      PAUSE 500
    
    
    
      char = LcdCrsrR
    
      FOR idx = 1 TO 15                             ' move cursor l-to-r
    
        GOSUB LCD_Cmd
    
        PAUSE 150
    
      NEXT
    
    
    
      FOR idx = 14 TO 0                             ' move cursor r-to-l by
    
        char = LcdDDRam + idx                       '  moving to a specific
    
        GOSUB LCD_Cmd                               '   column
    
        PAUSE 150
    
      NEXT
    
    
    
      char = %00001101                              ' cursor off, blink on
    
      GOSUB LCD_Cmd
    
      PAUSE 2000
    
    
    
      char = %00001100                              ' blink off
    
      GOSUB LCD_Cmd
    
    
    
    Flash_Demo:
    
      FOR idx = 1 TO 10                             ' flash display
    
        char = char ^ %00000100                     ' toggle display bit
    
        GOSUB LCD_Cmd
    
        PAUSE 250
    
      NEXT
    
      PAUSE 1000
    
    
    
    Shift_Demo:
    
      FOR idx = 1 TO 16                             ' shift display
    
        char = LcdDispR
    
        GOSUB LCD_Cmd
    
        PAUSE 100
    
      NEXT
    
      PAUSE 1000
    
    
    
      FOR idx = 1 TO 16                             ' shift display back
    
        char = LcdDispL
    
        GOSUB LCD_Cmd
    
        PAUSE 100
    
      NEXT
    
      PAUSE 1000
    
    
    
      GOTO Main                                     ' do it all over
    
    
    
    
    
    ' -----[noparse][[/noparse] Subroutines ]-----------------------------------------------------
    
    
    
    LCD_Cmd:
    
      LOW RS                                        ' enter command mode
    
    
    
    
    
    LCD_Out:
    
      LcdBus = char.HIGHNIB                         ' output high nibble
    
      PULSOUT E, 3                                  ' strobe the Enable line
    
      LcdBus = char.LOWNIB                          ' output low nibble
    
      PULSOUT E, 3
    
      HIGH RS                                       ' return to character mode
    
      RETURN
    
    
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-21 16:14
    For 3 of the LCD connections (E, R/W, RS) it doesn’t matter which side of the 2x7 socket you connect to, however for the data lines it does. Do you have the wires in the correct side?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • moo2moo2 Posts: 17
    edited 2007-09-21 17:12
    Yes, that was one of the things that I triple checked smile.gif .
    ·
  • moo2moo2 Posts: 17
    edited 2007-09-22 22:10
    Can anyone help me with this?
    I've triple checked my code, which came right from the stampworks CD. I've triple checked my connections. No matter what I do, I can't get anything at all to happen with the LCD.
  • ScottLawsonScottLawson Posts: 2
    edited 2007-09-23 02:54
    i couldnt get mine to work either, although i was only checking it out quickly, but i checked the pins and they were right and the code came straight from the CD.· Ill try it again tomorrow and see if i can getit to work
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-09-23 05:47
    Moo -

    Have you tried adjusting the constrast knob? Sometimes if it's too far one way or the other, there will be no visible characters on the screen.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • moo2moo2 Posts: 17
    edited 2007-09-23 11:50
    Thanks Bruce.
    Yes, I did try adjusting the contrast knob. In fact, that's the only way I'm able to see anything at all on the screen. If I turn the contrast all the way up, I can see the top row of characters become black. There are not any characters actually on the screen, but I see the entire top row become black squares where there would normally be characters.

    With the contrast adjusted normally, I see absolutely nothing on the display.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-24 17:35
    Okay,

    There are two options at this point. One would be to use the documentation on the following page to determine if the LCD works when wired directly to the I/O lines. The other would be to send the LCD and PDB in and have it tested by us. Just to verify, you aren’t connecting any resistors are you?

    http://www.parallax.com/detail.asp?product_id=603-00006

    Note: The Stamp Works documentation and schematic uses a different enable pin than the code/example at the link above.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • moo2moo2 Posts: 17
    edited 2007-09-24 17:49
    Thanks Chris.
    No I am not connecting any additional resistors to the circuit.

    Although I did find it strange that the LCD documentation at the link above (which is the same as the PDF doc that's on the StampWorks CD) and the StampWorks book list two different values for the resistors connected to the DB4, DB5, DB6, and DB7 lines. The LCD doc indicates that these lines use "All 10K" resistors, but the StampWorks book shows them as being 220 Ohm resistors. I can see from the PDB and the StampWorks book that these resistors are built into the PDB, but if I was to wire the LCD directly to the stamp, which resistors would I use? 10K or 220 Ohm?

    Also, I'm not an expert (obvoiusly) with schematics, but it appears to me that the schematic on page 2 of the PDF document shows Pin1 of the LCD board connected to both VSS and "+5" which I assume is VDD. This seems like it would cause a direct short between VSS and VDD. Please correct me if I'm wrong.

    It seems like there's lots of errors like this in the various Parallax products' documentation. I would like to assume that If·I fried something as a result of conflicting documentation, Parallax would replace it for me.

    Back on topic, I'm leaning towards the LCD being bad, and not the PDB. Can I send you just the LCD and have you send me a replacement? If so, please let me know where to send it, RMA numbers, etc.

    Thanks in advance...

    Post Edited (moo2) : 9/24/2007 5:54:09 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-09-25 00:50
    mmo2 said...
    it appears to me that the schematic on page 2 of the PDF document shows Pin1 of the LCD board connected to both VSS and "+5"
    Page 2 of which PDF?· Are you referring to this: http://www.parallax.com/dl/docs/prod/audiovis/lcd2x16par.pdf

    Looks clear to me.· There's a picture of the IDC-connector (App-Mod), the AppMod pin-out,·and an impeccable·circuit schematic.
    moo2 said...
    It seems like there's lots of errors like this in the various Parallax products' documentation.
    Libelous Rubbish; Total Nonsense.

    I think you stated the obvious problem when you wrote:
    moo2 said...
    I'm not an expert (obvoiusly) with schematics,
    ·
  • moo2moo2 Posts: 17
    edited 2007-09-25 03:34
    PJ Allen,
    I sincerely hope that's an ill-timed attempt at sarcasm. If not, allow me to feed the trolls for a minute.
    PJ Allen said...
    Page 2 of which PDF? Are you referring to this: http://www.parallax.com/dl/docs/prod/audiovis/lcd2x16par.pdf
    Yes, that is the one.
    PJ Allen said...
    Looks clear to me. There's a picture of the IDC-connector (App-Mod), the AppMod pin-out, and an impeccable circuit schematic.
    Correct. As I said, I'm referring to the schematic.
    PJ Allen said...
    Libelous Rubbish; Total Nonsense.

    I think you stated the obvious problem when you wrote:
    moo2 said...
    I'm not an expert (obvoiusly) with schematics,

    No, I'm not an expert, but I do know the difference between this:
    connected.jpg

    And this:
    unconnected.jpg

    Actually, the more times I read your post, the more I'm sure that you were joking. So, to that I'll say, touch'e....bravo!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-09-25 11:40
    En Garde, moo2.
    moo2 said...
    Also, I'm not an expert (obvoiusly) with schematics, but it appears to me that the schematic on page 2 of the PDF document shows Pin1 of the LCD board connected to both VSS and "+5" which I assume is VDD. This seems like it would cause a direct short between VSS and VDD. Please correct me if I'm wrong.
    So, where's the "short" then?

    attachment.php?attachmentid=49538


    Post Edited (PJ Allen) : 9/25/2007 11:45:25 AM GMT
    665 x 354 - 34K
  • moo2moo2 Posts: 17
    edited 2007-09-25 12:55
    Here you go...

    lcd.jpg
    The red circle indicates a junction to both the "+5" coming in from the left, and VSS coming up from the bottom.· How can pin 1 be connected to both VSS and "+5" at the same time?

    I suppose you think that the 220 Ohm resistors and the 10K Ohm resistors mentioned above are the same too, no?·How about the pinout of the LCD connector...The manual at http://www.parallax.com/dl/docs/prod/audiovis/lcd2x16par.pdf·lists DB6 at both pins 13 and pins 14...that's·perfectly OK to you, right?

    Anyway, I'm not here to argue with you.· If you don't have anything constructive to add regarding why my LCD doesn't work, then just don't bother replying to this thread.
    665 x 354 - 72K
    lcd.jpg 72.2K
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-09-25 13:08
    The diagram of the connector does look like a mistake with both pin 13 and 14 on the Stamp shown as connecting to DB6 on the LCD. However, the "short" you have indicated is not. There is the full 10k resistance of the pot between +5V and ground (Vss). It forms a voltage divider that is used to set the contrast on the LCD display by varying the voltage at pin 3 on the LCD.


    edit: the mistake I refer to is not in the schematic in the above posts, but in this diagram of the connector elsewhere in the documentation:

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick

    Post Edited (RDL2004) : 9/26/2007 2:04:17 AM GMT
    321 x 313 - 11K
  • moo2moo2 Posts: 17
    edited 2007-09-25 13:14
    RDL2004 Thanks. That makes sense, and is a good reason why I'm a programmer, not a hardware guy. I'll be the first to admit when I'm wrong. Thanks for taking the time to explain it to me, rather than making snide remarks.
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-09-26 02:20
    I looked at the StampWorks book tonight and I see what's confusing about the resistors. In the LCD documentation those 10k resistors are not doing the same thing as the 220 Ω resistors in the StampWorks experiments.

    In the LCD documentation the resistors are connected as "pull downs" from the data lines to ground (Vss), in the StampWorks experiments they are connected as current limiting resistors, directly in line between the Stamp pins and the LCD pins. I'm not sure why both types are not present in both cases.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
Sign In or Register to comment.