LCD Display - I2C

Anonym

Active member
Used an I2C display this time (well, it's really a regular one with an I2C adapter). Connected the SDA output to the SDA pin, the SDC output to the SDC pin, power to where it should be aand what do you know, it doesn't work. Code copied exactly from axe033 manual.
 

Attachments

Anonym

Active member
Think I used the wrong slave address - changed it to $4E thanks to someone's kind explanation in my I2C Adress post. But it still doesn't work.
 

westaust55

Moderator
Please advise the link to the i2c adapter board you are using.
Otherwise the interface chip on the board and you will also need to trace which pin on the chip goes to which pin on the LCD.

unfortunately there are several i2c to LCD adapters out there and until we know what you have there is no guarantee on the slave address or what code is needed.
 

Anonym

Active member
Please advise the link to the i2c adapter board you are using.
Otherwise the interface chip on the board and you will also need to trace which pin on the chip goes to which pin on the LCD.

unfortunately there are several i2c to LCD adapters out there and until we know what you have there is no guarantee on the slave address or what code is needed.
I am using an I2C adapter from AZ-delivery. Here is a link for the datasheet (https://bit.ly/380yCZR) and the thing itself (https://bit.ly/3agkJs7).
 

Hemi345

Senior Member
I had one of those "I2C backpacks" for an LCD I bought. I never did get it to work because they ground off the top of the IC so the markings weren't readable.

You won't be able to use the same serial commands as the AXE033. The I2C backpack is much more involved.
It looks like the IC on yours might be a PCF8574T. You can either read the datasheet http://www.ti.com/lit/ds/symlink/pcf8574.pdf or try to reconstruct the code in BASIC from the arduino code posted at: https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

(unless someone on here has already done it).
 

Anonym

Active member
I had one of those "I2C backpacks" for an LCD I bought. I never did get it to work because they ground off the top of the IC so the markings weren't readable.

You won't be able to use the same serial commands as the AXE033. The I2C backpack is much more involved.
It looks like the IC on yours might be a PCF8574T. You can either read the datasheet http://www.ti.com/lit/ds/symlink/pcf8574.pdf or try to reconstruct the code in BASIC from the arduino code posted at: https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

(unless someone on here has already done it).
Thanks! It all sounds and looks very complicated though... might end up buying a dedicated I2C display if it really is, we'll see...
 

lbenson

Senior Member
I don't remember whether the i2c module comes with pullup resisters on sda and scl. Can you confirm? if not present, you need them, e.g. 4K7.
 

hippy

Technical Support
Staff member
Code copied exactly from axe033 manual.
The problem there is that code only works with an AXE033, does not work with the cheap I2C-Expander backpacks.

The attached is my generic code for driving an I2C LCD backpack. It's very similar to the parallel 4-bit LCD interface code. Mostly the SendByte routine has changed.

You may have to alter the pin assignments to match the backpack but I believe this matches at least some of the common boards which use a PCF8754 which yours also seems to use.

If that doesn't work possible causes amongst others could be -

Crossed-over SDA and SCL lines
No I2C pull-ups
I2C Device Address wrong
Backpack tracking different to program settings.

What really had me confused is that photos of the board show a silk-screened square which suggests pin 1 of the backpack connector is on the left, nearest the jumper link, and that would connect to pin 1 on the LCD. But it isn't; the left-most pin seemingly does connect to pin 16 on the LCD. Utter insanity. The datasheet does however show it on the right. Total confusion. I couldn't see where it is in your photo.

Annoyingly the datasheet doesn't show how the LCD connector is wired to the chip. I couldn't find a schematic for the FC-113 board elsewhere and published annotations of pinouts are all clearly wrong. So, if the program isn't reflecting the correct tracking, there isn't a PCB image which shows how it is, you might have to resort to continuity checking every chip to LCD connector connection.
 

Attachments

Last edited:

hippy

Technical Support
Staff member
Looking at the datasheet - "LiquidCrsytal_I2Clcd(0x27,2,1,0,4,5,6,7,3,POSITIVE)" - and trawling Google it appears the backpack tracking may be -
Code:
;                 .----- Set to output pin number of I2C backpack driver chip
;                 |
Symbol lcdD4 = bit4    ; LCD Data Line 4
Symbol lcdD5 = bit5    ; LCD Data Line 5
Symbol lcdD6 = bit6    ; LCD Data Line 6
Symbol lcdD7 = bit7    ; LCD Data Line 7

Symbol lcdRS = bit0    ; Register Select - 0 = Command   1 = Data
Symbol lcdWR = bit1    ; Write Control   - 0 = Write     1 = Read
Symbol lcdE  = bit2    ; Command Strobe  - 0 = Idle      1 = Active
Symbol lcdBL = bit3    ; Backlight       - 0 = Off       1 = On
 

Anonym

Active member
Looking at the datasheet - "LiquidCrsytal_I2Clcd(0x27,2,1,0,4,5,6,7,3,POSITIVE)" - and trawling Google it appears the backpack tracking may be -
Code:
;                 .----- Set to output pin number of I2C backpack driver chip
;                 |
Symbol lcdD4 = bit4    ; LCD Data Line 4
Symbol lcdD5 = bit5    ; LCD Data Line 5
Symbol lcdD6 = bit6    ; LCD Data Line 6
Symbol lcdD7 = bit7    ; LCD Data Line 7

Symbol lcdRS = bit0    ; Register Select - 0 = Command   1 = Data
Symbol lcdWR = bit1    ; Write Control   - 0 = Write     1 = Read
Symbol lcdE  = bit2    ; Command Strobe  - 0 = Idle      1 = Active
Symbol lcdBL = bit3    ; Backlight       - 0 = Off       1 = On
Thanks a lot for all the help Hippy! Unfortunately, it seems like this solution (an I2C backpack) is a bit too complex for my project. I've ordered myself a new I2C OLED display which should hopefully be easier to set-up. I'll let the forum know if I have any problems with it!
 

hippy

Technical Support
Staff member
Unfortunately, it seems like this solution (an I2C backpack) is a bit too complex for my project.
Should be pretty easy if you can do that continuity check from the LCD connector pins and identify which legs on the chip they go.
 
Top