Pages: [1]   Go Down
Author Topic: 5V IIC/I2C/TWI LCD Module Adapter For Arduino from eBay  (Read 2288 times)
0 Members and 1 Guest are viewing this topic.
Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2601
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.

* LiquidCrystal_I2C Inverted.zip (1223.41 KB - downloaded 102 times.)
« Last Edit: May 05, 2013, 11:42:59 am by Riva » Logged


Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

   

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2601
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
Logged

   

Rome
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2601
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4411
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: March 12, 2014, 11:52:32 am by floresta » Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2601
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4411
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3671
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: