LCD 1602 I2C Issue with Arduino 1.0 release [SOLVED]

Hello,

I’ve a serious problem with Arduino 1.0 release.
Several weeks ago, I bought a MEGA2560, installed it with Arduino 1.0 release (on PC Windows XP SP3) … but I had problem to upload sketch on the card. After several hours searching information on the web, I found a message that advice to replace the avrdude.exe/avrdude.conf in 1.0 from 022 : after that all worked fine and all the sketches was uploaded without problem.

I’ve just added an LCD 1602 I2C V1 module (with PCF8574 I2C controler) : it didn’t work. The “Hello world” sketch compile but there is nothing on the LCD. So I had the idea to try the same sketch with the 0022 and 0023 release … and that works fine ! The wire and LiquidCrystal_I2C libraries are not the same in 1.0 and 002x. (I tried to replace the 1.0 releases by the 0023 releases, but of course that not work.).
I’ve also a DS1307 module and it works well as well with the 002x as the 1.0 release. So I suppose the I2C bus is OK in both releases, except if several functions are used with the LCD module and not with the DS1307... I don't know.

I’m really blocked because I need to use the Arduino 1.0 release because of Ethernet features that doesn’t exist in 002x. but I also need an LCD display !
Have you got such issue with the LCD 1602 I2C module ? Is there a solution ?

Thanks,

From yesterday, I continued to search a solution ... and my problem is now solved :slight_smile:
Here is my solution, maybe someone can use it ...
The solution consist to modify the following :

In LiquiCrystal_I2C.cpp
originated code (for the Arduino 1.0 release) :
...
// write either command or data
void LiquidCrystal_I2C::send(uint8_t value, uint8_t mode) {
** uint8_t highnib=value>>4;**
** uint8_t lownib=value & 0x0F;**
write4bits((highnib)|mode);
write4bits((lownib)|mode);
...
Changed to :
...
// write either command or data
void LiquidCrystal_I2C::send(uint8_t value, uint8_t mode) {
** uint8_t highnib=value&0xf0; **
** uint8_t lownib=(value<<4)&0xf0;**
write4bits((highnib)|mode);
write4bits((lownib)|mode);
...

and in the LiquiCrystal_I2C.h :
...
// flags for backlight control
#define LCD_BACKLIGHT 0x00
#define LCD_NOBACKLIGHT 0x80
...

Changed to
...
// flags for backlight control
#define LCD_BACKLIGHT 0x08
#define LCD_NOBACKLIGHT 0x00
...

Now my LCD 1602 I2C module works very well !! :slight_smile: