What is sent to I2C LCD to init it and make it display

I bought a RFRobot I2C LCD. It can be run on Arduino UNO platform. Coding is so easy because lower level program is hided behind. I read through RFRobot LCD libraries, wire libraries and even I2C protocol but still don't know what is sent to the LCD to initialize it and make it display. Can anybody help me? BTW, the reason why I am doing this is that I am working on a TI DSP project. I want to use DSP to drive LCD. So I need to know how to configure LCD.

The hd44780 data sheet has sections on how to initialize the LCD. Look around pages 22 & 45.

After you get the datasheet mentioned above you will find an explanation of the initialization procedure here. Follow the [u]LCD Initialization[/u] link.

Don

The hd44780 datasheet covers what to send to the LCD to control it. It assumes that host is directly controlling the LCD modules pins. However, when using an i2c based LCD like you mentioned, the host (Arduino) does not have direct control of the LCD module pins.

So what you won't see in the hd44780 datasheet is what to send over the i2c interface to control the LCD module pins. To know what to send over the i2c interface to control the LCD module pins, you will need to have a full understanding of the i2c backpack hardware. This will require understanding its design and layout / schematic. The device you mentioned uses a backpack with a PCF8574 i/o expander chip. You will need to understand that chip, and how its 8 bit output port pins are wired up to the LCD module pins and how one pin is potentially wired up to a backlight control circuit.

So it isn't as simple as just sending messages or bytes shown in the hd44780 datasheet over i2c to control the LCD. The Arduino talks the PCF8574 chip (not the LCD) using i2c and the PCF8574 output port pins talk to the LCD pins. You send bytes to the PCF8574 chip to control / manipulate the PCF8574 output port pins which are connected to the LCD.

Also keep in mind that i2c LCD backpacks have different designs. And different designs wire up the PCF8574 output port pins to the LCD in different ways. So if you hard code the s/w to assume a particular wiring it will only work on the i2c LCD backpacks that are wired up that particular way.

Some libraries, have chosen to use a single pin mapping, it is simpler and makes the code smaller. Some libraries, allow the pin mappings to be configured. One library auto detects the pin mappings.

--- bill

bperrybap: One library auto detects the pin mappings.

One ring ... :grinning:

bperrybap: . . . One library auto detects the pin mappings.

--- bill

Which library would that be??

Don

bperrybap:
The hd44780 datasheet covers what to send to the LCD to control it.
It assumes that host is directly controlling the LCD modules pins.
However, when using an i2c based LCD like you mentioned, the host (Arduino) does not have direct control of the LCD module pins.

So what you won’t see in the hd44780 datasheet is what to send over the i2c interface to control the LCD module pins.
To know what to send over the i2c interface to control the LCD module pins, you will need to have a full understanding of the i2c backpack hardware.
This will require understanding its design and layout / schematic.
The device you mentioned uses a backpack with a PCF8574 i/o expander chip.
You will need to understand that chip, and how its 8 bit output port pins are wired up to the LCD module pins and how one pin is potentially wired up to a backlight control circuit.

So it isn’t as simple as just sending messages or bytes shown in the hd44780 datasheet over i2c to control the LCD.
The Arduino talks the PCF8574 chip (not the LCD) using i2c and the PCF8574 output port pins talk to the LCD pins.
You send bytes to the PCF8574 chip to control / manipulate the PCF8574 output port pins which are connected to the LCD.

Also keep in mind that i2c LCD backpacks have different designs. And different designs wire up the PCF8574 output port pins to the LCD in different ways. So if you hard code the s/w to assume a particular wiring it will only work on the i2c LCD backpacks that are wired up that particular way.

Some libraries, have chosen to use a single pin mapping, it is simpler and makes the code smaller.
Some libraries, allow the pin mappings to be configured.
One library auto detects the pin mappings.

— bill

That is really an awesome reply. Thank you so much!
The controller here is AIP31068L.
I am going to write my own code to drive the I2C LCD. Do you have any suggestion?
My main reference is this graph.

floresta: Which library would that be??

Don

The hd44780 library using the hd4780_I2Cexp i/o class. But you knew that... :D

mingmike:
That is really an awesome reply. Thank you so much!
The controller here is AIP31068L.
I am going to write my own code to drive the I2C LCD. Do you have any suggestion?
My main reference is this graph.

In your first post you said:

mingmike:
I bought a RFRobot I2C LCD.

I’m not familiar with RFRobot. I have seen LCD devices from DFRobot. But the LCD devices I’ve seen use a backpack that uses a PCF8574.
If your device uses a AIP31068L, that is a very different device from the devices I described that use an i/o expander.
With that type of device, there are no pin mapping issues as that type of LCD device has native i2c support.
You send simple messages over i2c.
It is much simpler as you simply send a control byte to set the RS pin then send the data byte(s).

— bill

bperrybap: In your first post you said: I'm not familiar with RFRobot. I have seen LCD devices from DFRobot. But the LCD devices I've seen use a backpack that uses a PCF8574. If your device uses a AIP31068L, that is a very different device from the devices I described that use an i/o expander. With that type of device, there are no pin mapping issues as that type of LCD device has native i2c support. You send simple messages over i2c. It is much simpler as you simply send a control byte to set the RS pin then send the data byte(s).

--- bill

I look at the waveform. You are correct. Thank you for your help!

The hd44780 library has an i/o class, hd44780_I2Clcd, to support that type of LCD device. --- bill