Shop OBEX P1 Docs P2 Docs Learn Events
I2C controller for HD44780 LCD displays — Parallax Forums

I2C controller for HD44780 LCD displays

ercoerco Posts: 20,256
edited 2015-03-26 15:59 in General Discussion
I have several older parallel-input HD44780 LCD displays that were always in the "too much work to use, but too nice to toss" category, even before the Shack's blowout sale on $5 Parallax LCDs with that wonderful built-in serial interface. Just saw this I2C adapter to drive the older 44780/1602 types. Probably worth a shot for $1.66, I'm ordering one to try.

http://www.ebay.com/itm/M3AO-1602LCD-Display-IIC-I2C-TWI-SP-I-Serial-Interface-Board-Module-Port-/281169588018?pt=LH_DefaultDomain_0&hash=item4177036f32#ht_4399wt_1362

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2014-02-13 11:21
    The IC on board is a PCF8574 I2c port expander. Unless there is additional logic on the other side you will have to manage all aspects of the display in 4 bit mode. I acquired and am using the P.H. Anderson LCD117 chip which is a programmed PIC to interface with a wide variety of LCD's. Uses a single I/O pin for serial comms and the PIC manages the LCD. It does the initialization and all the bit twiddling, I just send it the data I want to display. It even has a command for double size characters if you are using a 20x4 display. Also provides a PWM output for backlight control.
  • Martin_HMartin_H Posts: 4,051
    edited 2014-02-13 13:23
    These I2C ports are popular with Arduino users because there's a library that hides all the I2C and 4 bit grunt work. With a BS2 these would be pretty hard to deal with. Porting the library to a Propeller might be doable. I have two P.H. Anderson LCD117 chips and they're much better as they're a single pin interface that works with the BS2, Arduino, or Propeller. Both Modern Device and Wulfden sell complete boards.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-02-15 18:04
    Hi Jonny;
    JonnyMac wrote: »
    I wrote some code last year that may be helpful.
    I see your code is designed for the PCA8574.
    How hard would it be to use with the PCA9554.
    The chip pinouts and i2c bus address are the same.

    Duane J
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-02-15 22:42
    Duaney,

    The PCA9554 has a few more tricks up its sleeve, but is still easy to use.

    Jon
  • jstjohnzjstjohnz Posts: 91
    edited 2014-03-28 20:55
    JonnyMac wrote: »
    I wrote some code last year that may be helpful.

    Just what I was looking for, thanks! Is it in need of tweaking or pretty much workable?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-03-28 21:19
    JonnyMac wrote: »
    I wrote some code last year that may be helpful.

    Thank Heavens! I haven't been able to get any clear documentation, though there are supposedly Arduino libraries for this.

    From what I can gather... it can be used with an LCD or as a port expander. But the trail goes cold with those claims of possiblity.

    I picked up one of these locally in Kaohsiung with a Funzino label on it and marked 1602 type IIc (It seems to be a second generation, Erco's picture seems to be a type I or another type iic variant).

    i am now actively trying to make it work on a Propeller with a 2x16 LCD / no backlight, and with Tachyon Forth.

    I presume the 1602 was intended to indicate it is to be used with 2x16 LCDs but it may work with all and anything if you have to initialize the LCD and it passes through all op codes without modification.

    The thing is without a schematic, so with several versions of the board floating around and the SPI addressing reconfigurable via on board jumpers... some reverse engineering may be useful.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-03-28 22:21
    Well, with the help of Jonny Mac's input, it now seems obvious that this only works in 4bit mode AND while there are 16 pins on the device's interface, 4 of them are not active (pins 7 through 10).

    NOTE _ I corrected the inactive pins and have attached a schematic

    If one wants to use the device as an i/o expander, one may only get 7 bits (or possibly 8 bits, but I know not where that last one is) out of it.

    NOTE_The 8th bit may be driven indirectly to provide back light power via pin 12
    951 x 676 - 457K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-03-29 05:31
    Well, with the help of Jonny Mac's input, it now seems obvious that this only works in 4bit mode AND while there are 16 pins on the device's interface, 4 of them are not active (pins 7 through 10).

    NOTE _ I corrected the inactive pins and have attached a schematic

    If one wants to use the device as an i/o expander, one may only get 7 bits (or possibly 8 bits, but I know not where that last one is) out of it.

    NOTE_The 8th bit may be driven indirectly to provide back light power via pin 12

    How ridiculous that they have followed the wayback original recommended "4-bit CPU data bus" connections so blindly that they even connect the R/W bit! How ludicrous, with the I2C interface and a 4-bit connection there is no way in the wide world that the busy could ever be read fast enough to even see if it was busy. Ergo, this is even more redundant than with a parallel interface. Anyway, the Forth code for this is trivial so if it starts to look complicated then it's the wrong way.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-03-29 09:36
    This is the case of an Arduino device that may actually cheaper than just buying the chip without a board. So it becomes a handy, but awkward i/o expander.


    ++++++
    Above all...
    Before I get started with creating code in Forth, Jonny Mac has provide a complete package of Spin code that will allow me to confirm that the device works.

    I know that this is a Parallax standard... providing code that proves the product you bought is in good order. But this is not exactly a Propeller product.

    Thanks for making it that much easier to use.
  • jstjohnzjstjohnz Posts: 91
    edited 2014-03-29 23:03
    I just fired up Jon's code on a 4x20 LCD and it works like a champ. Thank you Jon, that's going to be a big time saver.
  • 304bl304bl Posts: 1
    edited 2014-05-18 13:16
    Hello guys , i using HD44780 with the controller PCA8574 connect by i2c.

    i have been able to make it work : init the lcd (16x2) , draw character but the problem i got is when i want to set the cursor position.
    i send the command for put the cursor to the first position of the second line who should be 0x80 + the adress (0x40 for the first of second line) then i send 0xC0.

    but nothing happend , the cursor stay at is position , i don't really know what i'm lacking.
    if someone got an idea of something i maybe missed.
  • MJBMJB Posts: 1,235
    edited 2015-03-26 15:59
    i am now actively trying to make it work on a Propeller with a 2x16 LCD / no backlight, and with Tachyon Forth.
    Hi Loopy,
    just found this old thread.
    Did you try and succeed with Tachyon?
    Or do you know of Tachyon code.
    Just got those modules too to use with a load of displays waiting.
    Thanks,
    Markus

    [edit] just found Peter's code for the 8-bit parallel version of this display driver.
    so it only needs adaption to 4-bit and I2C ...
    but if somebody did this already I'd prefer that ;-)
Sign In or Register to comment.