Go Down

Topic: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay (Read 2558 times) previous topic - next topic

Riva

May 05, 2013, 05:52 pm Last Edit: May 05, 2013, 06:42 pm by Riva Reason: 1
I bought one of those very cheap I2C modules 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 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.

fm

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.
   

Riva


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.


Qbert

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?

Riva


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.

floresta

#6
Mar 12, 2014, 05:50 pm Last Edit: Mar 12, 2014, 05:52 pm by floresta Reason: 1


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

Riva




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 is a binary state so "Digital control of LCD backlight brightness" is on/off AFAIC.

floresta

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

Paul__B

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 and bperrybap's guesser.

Go Up