Shop OBEX P1 Docs P2 Docs Learn Events
Parallel LCD help — Parallax Forums

Parallel LCD help

Microman171Microman171 Posts: 111
edited 2005-07-23 03:40 in BASIC Stamp
My parallel LCD has 16 pins and i dont know how to wire any help?

Thanks in advancee,

Micro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = Window

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
0............................................0
0............................................0
0.(Microman171@hotmail.com)..0
0............................................0
0............................................0
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-20 12:31
    Look in the manual or online help file under the LCD instructions (LCDCMD, LCDIN, LCDOUT) -- there are connection diagrams for parallel LCDs there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Microman171Microman171 Posts: 111
    edited 2005-07-21 00:42
    My stamp is BS2 can you help i have tis code that you once posted 'SW20-EX11-LCD_Demo.BS2' but when i wire my lcd nothing happens

    here is some pin names

    1 = Ground (0v)
    2 = Supply Voltage fo Logic (+5v)
    3 = Contrast Adjustment
    4 = Data / Instruction Select (RS)
    5 = Read / Write Select (R/W)
    6 = Signal Enable (E)
    7 - 14 = Data Bus Line (DB0 - DB7)
    16, 15 = No connection

    And also there are thesse pins on the side that I don't know what there for (A and K)

    Thankyou

    Micro
    PS This LCD is non-Backlit smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 + 1 = Window

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    0............................................0
    0............................................0
    0.(Microman171@hotmail.com)..0
    0............................................0
    0............................................0
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-21 01:42
    Double-check your connections against those named in the listing -- you may have the E signal connected to the wrong pin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • AmaralAmaral Posts: 176
    edited 2005-07-21 03:51
    what's the part number of your LCD ?
    I'm Asking because I found some ITM 1602A from Intec , real cheap, but the seller didn't know anything about it , then I just did not buy, ( that was today in the afternoon ) I'm looking for this specs now and this looks like the same ( at least the pin numbers )

    Ricardo Amaral
  • Microman171Microman171 Posts: 111
    edited 2005-07-22 23:01
    www.dse.co.nz/cgi-bin/dse.storefront/42e17b2903973cf6273fc0a87f99070f/Product/View/Z4170 That is the model I got I dont know the model number.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 + 1 = Window

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    0............................................0
    0............................................0
    0.(Microman171@hotmail.com)..0
    0............................................0
    0............................................0
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-22 23:09
    Hello,

    ·· The datasheet on that web page you listed clearly indicates the connections for this LCD.· For simplicity you can usually connect pin 3 to Vss (Ground).· On your LCD pins 15/16 are no connection.· The rest just double-check with what you should have.· Also, remember, for 4-bit mode you'll use DB4-DB7 not the first 4 data lines (DB0-DB3).·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Microman171Microman171 Posts: 111
    edited 2005-07-22 23:22
    Can you please post code for that thanks smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 + 1 = Window

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    0............................................0
    0............................................0
    0.(Microman171@hotmail.com)..0
    0............................................0
    0............................................0
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  • Microman171Microman171 Posts: 111
    edited 2005-07-22 23:48
    Nevere Mind. I have it working, the thing I had wrong was a little bit of wiring went wrong so I fixed that and it works. Thanks for all your help guys jumpin.gifjumpin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 + 1 = Window

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    0............................................0
    0............................................0
    0.(Microman171@hotmail.com)..0
    0............................................0
    0............................................0
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  • Microman171Microman171 Posts: 111
    edited 2005-07-23 00:22
    Now that I have the code up and running I want to know how to use this and use the two lines eg

    The BASIC STAMP!
    by The LCD


    I think the code I have runs in 4 bit (not sure)

    please send full code and how to use it thanks

    Micro smilewinkgrin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 + 1 = Window

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    0............................................0
    0............................................0
    0.(Microman171@hotmail.com)..0
    0............................................0
    0............................................0
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  • CheechCheech Posts: 30
    edited 2005-07-23 02:52
    How are you going to learn if other people write all the code for you? At least you could try and post what you have. I would be ashamed to ask flat out for ALL the code, but that's just me.
  • Microman171Microman171 Posts: 111
    edited 2005-07-23 03:40
    Sorry Cheech,

    this is the code I have

    ' =========================================================================
    '
    '   File....... SW20-EX11-LCD_Demo.BS2
    '   Purpose.... Essential LCD control
    '   Author..... (C) 2000 - 2005, Parallax, Inc.
    '   E-mail..... support@parallax.com
    '   Started....
    '   Updated.... 01 JUN 2005
    '
    '   {$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    "0123456789abcdef0123456789abcdef", 0   ' store message
    
    
    ' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
    
    Reset:
      #IF (LcdReady) #THEN
        #ERROR "Please use BS2p version: SW20-EX11-LCD_Demo.BSP"
      #ENDIF
    
      DIRL = %11111110                              ' setup pins for LCD
      PAUSE 1000                                    ' 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 = %00101000
      GOSUB LCD_Cmd
      char = %00001100                              ' disp on, no crsr or 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
    
    



    And I want to know how to put a line break in this codee and where smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 + 1 = Window

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    0............................................0
    0............................................0
    0.(Microman171@hotmail.com)..0
    0............................................0
    0............................................0
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

    Post Edited (Microman171) : 7/23/2005 11:23:30 PM GMT
Sign In or Register to comment.