Shop OBEX P1 Docs P2 Docs Learn Events
Arduino IIC/I2C/TWI 1602 Serial LCD Module — Parallax Forums

Arduino IIC/I2C/TWI 1602 Serial LCD Module

arnold113arnold113 Posts: 43
edited 2013-04-07 05:46 in BASIC Stamp
I'm new to the Basic Stamp 2, so I've got a lot to learn. I bought the Arduino serial lcd display before I knew what I was doing. I hope you can help me. Can this I2C module be used with the BS2? Money is tight around here so I need to be able to use it if possible. If it can be used, then please help me understand how to write the program to com with it.
Thanks for your help Arnold

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-09-24 07:43
    Link it!
    If it's I2C, it's "serial", just not asynchronous serial.
    It's possible that you could use it with a BS2, but that will require bit-banging.
    That could be kind of slow.
    So, more details, please (provide that link.)
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-09-24 07:47
    If it's like this -- http://emartee.com/product/41872/Serial%20LCD%201602%20Shield%20%20Arduino%20Compatible
    and if it's the HD44780-type display driver on it
    I'd be tempted to remove that red piggyback board and use it in 4-bit parallel mode, examples of which are many.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-09-24 07:57
    Here's a Nuts & Volts article about doing I2C with the BS2 --
    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol5/col/nv115.pdf
  • arnold113arnold113 Posts: 43
    edited 2012-09-25 02:34
    I'm designing my own version of a sprinkler system controller. I've got working code for all now except the 16 x 2 LCD display. I'm using a 4x4 matrix keypad so thats uses up 8 I/O pins also a 4 to 16 decoder for output to 16 relay modules. Only 4 pins left for serial and whatever so going parallel for the display isn't an issue. I'll get busy reading the nuts and volts link.
    Thanks again.
    Arnold
  • vaclav_salvaclav_sal Posts: 451
    edited 2012-09-25 07:14
    arnold113 wrote: »
    Only 4 pins left for serial and whatever so going parallel for the display isn't an issue.
    If you have ONLY 4 I/O pins left, you are better off using serial synchronous I2C protocol - two I/O pins. If you opt for removing the I2C "module" ( I would guess it is soldered to the 1602 anyway!) than you need minimum of 4 data pins PLUS R/W and couple of others to control the standard 1602 module directly. By standard I mean it (1602) uses parallel interface. Of course you can get true serial LCD too, but that is an additional expense. ( And you alrady have one!)

    It is your decision , but I do not see how using I2C protocol would "slow down" the LCD display to be of concern in your application.

    Actually - I2C would be faster than "recomeneded" maximum RS232 serial speed of 9600 bauds for BS. This recomended max speed limitation should not apply to transmit speed. There is a I2C speed parameter somewhere in Parallax decumentation.
    Both protocols should be OK for LCD updates.

    Also keeep in mind that the 1602 "driver" firmware is the one actually updating the display.
  • arnold113arnold113 Posts: 43
    edited 2012-09-29 08:28
    I've been reading thru the nuts and volts article and I've got a question. I don't seem to get it, that is , the way to load setup and data into the lcd display module. Please walk me thru it step by step. The display I'm using has a PCF8574T EEPROM.
    Thanks again
    Arnold
    PS I'm using the I[EMAIL="I@C"]2C[/EMAIL] serial bd.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-09-29 08:47
    The Nuts & Volts article is about I2C and its examples focus on reading/writing a couple of I2C devices, demonstrating the SDA and SCL and so on.
    There's not a generic, quick and easy way to just transpose all that into I2C LCD subroutines.
    If you have a link to your specific LCD's example code and/or its datasheet then please post links to all of that.
  • arnold113arnold113 Posts: 43
    edited 2013-03-26 07:47
    I'm back. Sorry about the inactivity but I've been busy on other projects, as in "Honey do's". I've been trying to get the instruction set for the Sure Electronics 1602 LCD display but haven't had any luck. Is there anyone out there that has a copy of the instruction set? Without that I'm dead in the water. Any help would be great. Thanks
  • arnold113arnold113 Posts: 43
    edited 2013-04-06 06:57
    Please forget about my last replay about the sure electronics 1602 display. My display is a Arduino IIC/I2C/TWI 1602 display not a sure electronics display. Anyway, I found the info on my device. The link to it is: http://arduino-info.wikispaces.com/file/detail/LiquidCrystal_I2C1602V1.zip The following is a sample program for this display. My question is, How do change it to work with a Basic Stamp 2? /* YourDuino.com Example Software Sketch
    LCD Display Blue/Yellow: I2C/TWI Interface
    terry@yourduino.com */
    /*
    ( Import needed libraries )
    */
    #include <Wire.h>
    #include <LiquidCrystal_I2C.h>
    /*
    ( Declare Constants )
    */
    /*
    ( Declare objects )
    */
    LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27
    /*
    ( Declare Variables )
    */

    void setup() /*----( SETUP: RUNS ONCE )----*/
    {
    Serial.begin(9600);
    lcd.init(); // initialize the lcd
    lcd.backlight();
    // Print a message to the LCD.
    lcd.setCursor(0, 0);
    lcd.print("2-Line DISPLAY");
    delay(1500);
    lcd.setCursor(0, 1);
    lcd.print("YourDuino: HI!");
    }/*--(end setup )---*/

    void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
    {
    {
    // when characters arrive over the serial port...
    if (Serial.available()) {
    // wait a bit for the entire message to arrive
    delay(100);
    // clear the screen
    lcd.clear();
    // read all the available characters
    while (Serial.available() > 0) {
    // display each character to the LCD
    lcd.write(Serial.read());
    }
    }
    }
    }/* --(end main loop )-- */
    /*
    ( Declare User-written Functions )
    */

    /* ( THE END ) */

    Any help, Any one???
    Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2013-04-06 08:51
    The PCF8574 is an I2C I/O Expander which, from the Arduino library, seems to be the interface to a standard parallel LCD (not an EEPROM). It would be possible to make this work on a BS2 Stamp, but it would involve a couple of hours of work and a lot of code in a relatively small memory device. I don't recommend it. It's not a project for a beginner, but would be straightforward for someone experienced in both Arduino and Stamp programming.
  • arnold113arnold113 Posts: 43
    edited 2013-04-06 18:53
    Thanks for your help. I guess I'll have to rethink this project. Thanks again
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-07 05:46
    From the picture of it at the following link
    http://arduino-info.wikispaces.com/LCD-Blue-I2C
    it looks like that YwRobot board could be removed and the display then used in a/its ("native") 4-bit parallel fashion, as I surmised last year.
    [The desoldering operation requires some skill.]
    Then you could use it, basically, as described in the following link
    http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/lcd2x16par.pdf
    That's a 2x16 and you have a 4x20, the only difference being in accessing the rows. If you get that far, post your questions about that then.

    Barring that, an Arduino clone can be had for around $20.
Sign In or Register to comment.