I2C LCD display help needed

I'm trying to interface a BS2px to a 32054 LCD 4x20 display I got from MPJA Electronics. They sell surplus gizmos - with little or no documentation. It has a piggy-back board for I2C interface. I see all kinds of Arduino code online, but nothing for Parallax. Has anyone done this and if so can you supply me with a little code to send ASCII characters to the display?
Any help is appreciated.

Comments

  • The good news is that the BS2px has built-in I2C protocol, so you don't have to synthesize it.

    The bad news is you are gonna have to study the Ardu*no code to figure what the start-up protocol is, and how to position the cursor. Once you get that squared away, you ought to be able to just bang away with ASCII characters.
  • I am NOT a programmer. That's why I chose Stamp for my microcontroller apps. Does anyone have any sample code that can give me a "leg up" on this project. I just need to clear the screen, home the cursor, print ASCII characters (with CR/LF). Any and all help is greatly appreciated.
  • The 32054 LCD 4x20 display does not sound like a mainstream display, that's why you have not got a dozen replies. At the very least, you must supply some information such as data sheet or even the ARD** code so someone can look at it. Even though you are not a programmer the BS2px is not going to program itself. It needs more "input".
  • Capt. QuirkCapt. Quirk Posts: 806
    edited 2020-01-03 - 07:26:31
    I think you got your part # incorrect: #35054 4x20 LCD.

    If so that is an 4x20 HD44780 with an I2c adapter. There is plenty of 4/8
    bit BS2 code 4x20 HD44780 without the I2c adapter. Perhaps after reading
    a few app notes or watching a few youtube videos, you can convert an 4 bit
    parallel program to I2c.

    Here is a Nuts Volts Basic Stamp article on I2C. and a forum post on your
    problem.


    Bill M.

    I like Ken Gracy's mill speedo.bs2 (lcd code) as a starting point, or find
    Stamp Works.pdf
  • Well, thanks everyone for the input. Taking Arduino code apart is way beyond me. And since I have no other info on the I2C input LCD display, I guess I'm done. Too bad as I had some great ideas involving using the serial I2C input display. Out of my depth here. Thanks everyone.
  • Capt. QuirkCapt. Quirk Posts: 806
    edited 2020-01-09 - 03:18:50
    It is too bad that you purchased an lcd with a I2C
    converter :( The Basic Stamp code for the bsp LCD
    commands in 4-bit parallel is an simple starting point
    for a project.
    '=========================================================================
    '   File...... Parallel_LCD_2X16.bsp
    '   Purpose... Parallel LCD Display Demo
    '   Author.... Parallax, Inc.
    '   E-mail.... support@parallax.com
    '   {$STAMP BS2p}
    '   {$PBASIC 2.5}
    ' -----[ Program Description ]---------------------------------------------
    ' This program demonstrates using a Hitachi-compatible Parallel LCD Display
    ' This code works with the BS2p24, BS2p40, BS2pe and BS2px24
    ' -----[ I/O Definitions ]-------------------------------------------------
    Lcd             PIN     0               ' LCD Enable Pin
    ' -----[ Variables ]-------------------------------------------------------
    temp            VAR     Byte
    char            VAR     Byte
    ' -----[ 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
    ' -----[ Main Routine ]----------------------------------------------------
    Main:
      DO
        LCDOUT Lcd, 1, ["Hello, this is"]   ' Clear LCD & Print Line 1 Text
        LCDOUT Lcd, 192, ["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
    
  • Thanks - I think I'll pry the serial adapter off and try this!
    And to all the other responders... Thanks too!
Sign In or Register to comment.