[SOLVED] Arduino Due and LiquidCrystal_I2C

Hi,

I've an arduino due bord and i've just a i2c lcd (Quimat I2C LCD 2004/20 ) , and when i use the LiquidCrystal_I2C , it doesn't work because it's a SAM arquitecture instead of an AVR arquitecture.

Is there someone who knows which library i would use?

Thanks!

I Googled "Arduino Due and LiquidCrystal_I2C" and got about 60,000 hits. Maybe there is help there.

That LCD appears to be a 5V device. Are you supplying it with 5V? Do you have level shifters on the SDA and SCL lines? Does the LCD address show up when you run an I2C scanner program?

In fact, level shifters are not necessary (but safer) if pull up resistors are connected to 3.3V as they should.

http://2manyprojects.net/lcd-tutorial

groundFungus:
I Googled "Arduino Due and LiquidCrystal_I2C" and got about 60,000 hits. Maybe there is help there.

That LCD appears to be a 5V device. Are you supplying it with 5V? Do you have level shifters on the SDA and SCL lines? Does the LCD address show up when you run an I2C scanner program?

Yes I've donde all that but i'm not able to put it in work :frowning:

ard_newbie:
In fact, level shifters are not necessary (but safer) if pull up resistors are connected to 3.3V as they should.

Level shifters not being necessary is not a fact and a key part of that statement is the back end of it:
"if pull up resistors are connected to 3.3V as they should"

Many if not most of the low cost devices like LCD backpacks and LCD modules have on board pullups that connect
to the supplied VCC.
What that means when using them "as supplied/shipped" and supplying them with 5v (which they need) they will have on board pullups going to 5v.
So in most cases when using these types of 5v devices, the i2c signals will not have pullups connected only to 3.3v
as the 5v slaves are connecting the i2c signals to pullups going to 5v.

The DUE board doesn't really have a "I2C Voltage Translator" as labeled on the schematic.
That circuitry is just on board pullups to 3.3v
Those pullups will prevent damage to the DUE processor in most cases when a single I2C slave is used as
the DUE pullups will fight the 5v slave pullups to pull the i2c signals down to a lower level that is usually safe for the processor.
However, depending the pullups used on the 5v i2c slave and how many 5v slaves are connected to the bus,
this can change and voltage may rise up to damaging levels.

My recommendation would be use a level shifter. They are very inexpensive and will prevent any sort of damage to the DUE from pullups on 5V slaves. It will also make the signals more reliable and allow using both 3v and 5v i2c slaves since it creates a bus for each voltage.

In terms of libraries, I would recommend using my hd44780 library with the hd44780_I2Cexp i/o class.
It will auto locate the LCD and can auto configure the PCF8574 to LCD pin mappings and backlight control.
It also includes a diagnostic sketch, I2CexpDiag, to verify that the LCD and library are properly working.
It is available in the IDE library manager for quick and easy installation.
You can read more about it here: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

--- bill

bperrybap:
Level shifters not being necessary is not a fact and a key part of that statement is the back end of it:
"if pull up resistors are connected to 3.3V as they should"

Many if not most of the low cost devices like LCD backpacks and LCD modules have on board pullups that connect
to the supplied VCC.
What that means when using them "as supplied/shipped" and supplying them with 5v (which they need) they will have on board pullups going to 5v.
So in most cases when using these types of 5v devices, the i2c signals will not have pullups connected only to 3.3v
as the 5v slaves are connecting the i2c signals to pullups going to 5v.

The DUE board doesn't really have a "I2C Voltage Translator" as labeled on the schematic.
That circuitry is just on board pullups to 3.3v
Those pullups will prevent damage to the DUE processor in most cases when a single I2C slave is used as
the DUE pullups will fight the 5v slave pullups to pull the i2c signals down to a lower level that is usually safe for the processor.
However, depending the pullups used on the 5v i2c slave and how many 5v slaves are connected to the bus,
this can change and voltage may rise up to damaging levels.

My recommendation would be use a level shifter. They are very inexpensive and will prevent any sort of damage to the DUE from pullups on 5V slaves. It will also make the signals more reliable and allow using both 3v and 5v i2c slaves since it creates a bus for each voltage.

In terms of libraries, I would recommend using my hd44780 library with the hd44780_I2Cexp i/o class.
It will auto locate the LCD and can auto configure the PCF8574 to LCD pin mappings and backlight control.
It also includes a diagnostic sketch, I2CexpDiag, to verify that the LCD and library are properly working.
It is available in the IDE library manager for quick and easy installation.
You can read more about it here: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

--- bill

Thanks for your help!

Finally the problem was that i'm dommy and i dind't set up the brightness XD