Arduino Forum

Using Arduino => Displays => Topic started by: Riva on May 05, 2013, 05:52 pm

Title: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: Riva on May 05, 2013, 05:52 pm
I bought one of those very cheap I2C modules (http://www.ebay.co.uk/itm/5V-IIC-I2C-TWI-1602-2004-Serial-LCD-Module-Display-Adjust-Adapter-For-Arduino-/390545994871?pt=LH_DefaultDomain_0&hash=item5aee5af477) from eBay for connecting to the back of a standard LCD so you can access it using I2C and reduce pins count needed. I downloaded the standard 'LiquidCrystal_I2C' library for controlling the PCF8574P chip used on this board from here (http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/) but found it did not work.
After trying several other LiquidCrystal_I2C libraries I gave up and decided to find out what the problem was and discovered the pin order connecting to the LCD from the PCF8574P was nibble reversed compared to what the library was expecting and the LED control logic was also reversed.
Code: [Select]
PCF8574P  Expected  Actual
  P0       D4        Rs
  P1       D5        R/W
  P2       D6        En
  P3       D7        LED
  P4       En        D4
  P5       R/W       D5
  P6       Rs        D6
  P7       LED       D7

I changed a few lines and added nibble swap code to the library for other who may have suffered the same problem.

EDIT: Forgot to say that despite the eBay example saying the I2C address is 0x20 it was 0x27 on mine.
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: fm on May 05, 2013, 05:56 pm
Why don't you give the New LiquidCrystal library a shot. Specially now that you've figured out the pinout. It's faster and works great in I2C mode. In addition is fully compatible with the stock LiquidCrystal library code.
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: Riva on May 05, 2013, 06:04 pm

Why don't you give the New LiquidCrystal library a shot. Specially now that you've figured out the pinout. It's faster and works great in I2C mode. In addition is fully compatible with the stock LiquidCrystal library code.

I'm using 1.0.3 at the moment but see nothing in the arduino reference about the LiquidCrystal library using I2C. Please show me where your referring to.
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: fm on May 05, 2013, 06:20 pm
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home (https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home)
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: Qbert on Mar 12, 2014, 04:27 pm
I'm interested in that cheap module too. Please, may you confirm that it has "Digital control of LCD backlight brightness", as LCD Backpack - I2C has?
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: Riva on Mar 12, 2014, 05:17 pm

I'm interested in that cheap module too. Please, may you confirm that it has "Digital control of LCD backlight brightness", as LCD Backpack - I2C has?

Yes it does, a simple on/off control.
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: floresta on Mar 12, 2014, 05:50 pm


I'm interested in that cheap module too. Please, may you confirm that it has "Digital control of LCD backlight brightness", as LCD Backpack - I2C has?

Yes it does, a simple on/off control.

Then don't you mean "No it doesn't, it only has simple on/off control" ?

Don
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: Riva on Mar 12, 2014, 06:27 pm



I'm interested in that cheap module too. Please, may you confirm that it has "Digital control of LCD backlight brightness", as LCD Backpack - I2C has?

Yes it does, a simple on/off control.

Then don't you mean "No it doesn't, it only has simple on/off control" ?

Don

Digital (http://en.wikipedia.org/wiki/Digital_signal) is a binary state so "Digital control of LCD backlight brightness" is on/off AFAIC.
Title: Re: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay
Post by: floresta on Mar 12, 2014, 06:56 pm
Quote
Digital is a binary state so "Digital control of LCD backlight brightness" is on/off AFAIC.

If the adapter can digitally turn the backlight on and off quickly enough and in the right proportion, as in pulse-width-modulation, the adapter can control the brightness digitally.

If this adapter can only turn the backlight ON and OFF then it can provide some digital control of the backlight but it cannot control the backlight brightness.

Don
Title: Yet another pissing contest!
Post by: Paul__B on Mar 12, 2014, 10:34 pm
Actually, I thought Riva's reply was pretty much on the mark.

Slightly more elegant would have been to say "Yes it does, there are (exactly) two brightness levels."

The point being made is of course, that none of these modules provides anything else.  You can most certainly implement PWM if you like at the expense of keeping your I2C bus and your main loop very busy.

I came into this area whilst spending three weeks in hospital (with Wi-Fi) a year ago; it seems that was about the time these various modules became available.  The full answer to the original problem in the event was fmalpartida's library (https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home) and bperrybap's guesser (http://forum.arduino.cc//index.php?topic=157817.msg1235230#msg1235230).