I2C LCD printing strings
Moderator: Benj
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
I2C LCD printing strings
Hello everyone,
We are trying to print strings on a I2C LCD for a school project, we tried a lot of different ways to do this but it just won't work.
We are using a I2C LCD Display with a PCF8574T module. Could someone post a example code in Flowcode or help us in any other way.
"LCDAansturing2" is the program we used the last time..
Thanks
We are trying to print strings on a I2C LCD for a school project, we tried a lot of different ways to do this but it just won't work.
We are using a I2C LCD Display with a PCF8574T module. Could someone post a example code in Flowcode or help us in any other way.
"LCDAansturing2" is the program we used the last time..
Thanks
Re: I2C LCD printing strings
If you post your program here I can have a look at it as I've used those modules very successfully. Just check that you have the correct I2C address in the properties menu. I used 63 as the LCD address, Baud Select 400kHz.
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: I2C LCD printing strings
Hi!
I have made a test with an Ariduino Mega. I used the default settings also with IC adress 32. Work perfect for me.
Br Jorgen.
I have made a test with an Ariduino Mega. I used the default settings also with IC adress 32. Work perfect for me.
Br Jorgen.
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
Re: I2C LCD printing strings
Hi @jgu1,
Nice, I find it so frustrating because it shouldn't be that hard..
@keejay
I will post it here tomorrow because I don't have it on my computer..
The weird thing is that we're able to put the backlight on/off, but we can't do anything else..
I can't update my Flowcode for some reason, that's why I can't use the macros we are using in school.
We are using a PIC16F887 as Master and the LCDs address should be 0x27 but we will try to use 63 tomorrow.
Nice, I find it so frustrating because it shouldn't be that hard..
@keejay
I will post it here tomorrow because I don't have it on my computer..
The weird thing is that we're able to put the backlight on/off, but we can't do anything else..
I can't update my Flowcode for some reason, that's why I can't use the macros we are using in school.
We are using a PIC16F887 as Master and the LCDs address should be 0x27 but we will try to use 63 tomorrow.
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
Re: I2C LCD printing strings
I just found out that the address we are using is 0x4E, and that this is the right address.. So the address is not the problem.
Re: I2C LCD printing strings
It often gets suggested on this forum to included a 1 second LED flasher in your flowcode to make sure that your basic program, config bits and timing are all correct. Then one can have a look at things like hardware connections and components properties. That's about all I can suggest without seeing your program.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: I2C LCD printing strings
Hello,
I don't believe that expander IC is currently supported. Do you have an example library that shows how the driver is used as that should help us to build a new LCD component for you.
I don't believe that expander IC is currently supported. Do you have an example library that shows how the driver is used as that should help us to build a new LCD component for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
Re: I2C LCD printing strings
Dear Benj,
In the latest update there is a new LCD Component that supports this expander but it didn’t work for us.. We are now trying to get it working with our first method we tried by just doing it without the LCD component,( slave address(0x4E), register select ‘0’, the instruction and a stop). With the LCD component we are only able to turn the backlight ON/OFF. I will upload that program when I get home!
In the latest update there is a new LCD Component that supports this expander but it didn’t work for us.. We are now trying to get it working with our first method we tried by just doing it without the LCD component,( slave address(0x4E), register select ‘0’, the instruction and a stop). With the LCD component we are only able to turn the backlight ON/OFF. I will upload that program when I get home!
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
Re: I2C LCD printing strings
Here is the program that I'm going to test tomorrow. I will let you guys know what it did or what it didn't..
- Attachments
-
- MasterPieceLCD4E.fcfx
- (17.38 KiB) Downloaded 391 times
Re: I2C LCD printing strings
I've posted a FC that I quickly tested on actual hardware and works fine. I've always added a small delay before and after initializing a display to allow it to settle down before using it. I only do that once at the beginning of the program. Hope this helps...
- Attachments
-
- I2C_Example.fcfx
- (7.66 KiB) Downloaded 405 times
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: I2C LCD printing strings
Hi!
Why doesn´t you use the I2C component, maybe I have misunderstanding something? If I have forget this please.
I have made a modification in your program, You could give it a go, it is the same test I made with my Arduino Mega and it work.
If it is these module you use: https://www.ebay.co.uk/itm/IIC-I2C-TWI- ... 3059022354
remember to solder the pad A0 A1 A2 and check the connection.
Br Jorgen
Why doesn´t you use the I2C component, maybe I have misunderstanding something? If I have forget this please.

I have made a modification in your program, You could give it a go, it is the same test I made with my Arduino Mega and it work.
If it is these module you use: https://www.ebay.co.uk/itm/IIC-I2C-TWI- ... 3059022354
remember to solder the pad A0 A1 A2 and check the connection.
Br Jorgen
- Attachments
-
- MasterPieceLCD4E.V2fcfx.fcfx
- (20.33 KiB) Downloaded 341 times
Re: I2C LCD printing strings
Hi Jorgen,
It looks like you've added the I2C master component, but don't use it in the program, so its actually redundant. You can delete it and the program will still work exactly the same. I think the LCD I2C component has the built in I2C functionality without the need to make use of the I2C master component.
This is the module that I use:
WINGONEER 5PCS IIC I2C TWI SPI Serial Interface Board Module Port for Arduino LCD1602 Display https://www.amazon.com/dp/B06XHGYYWB/re ... wCb1Y8XTTM
It looks like you've added the I2C master component, but don't use it in the program, so its actually redundant. You can delete it and the program will still work exactly the same. I think the LCD I2C component has the built in I2C functionality without the need to make use of the I2C master component.
This is the module that I use:
WINGONEER 5PCS IIC I2C TWI SPI Serial Interface Board Module Port for Arduino LCD1602 Display https://www.amazon.com/dp/B06XHGYYWB/re ... wCb1Y8XTTM
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
Re: I2C LCD printing strings
Hi guys,
Not one of the programs is working for us.. Maybe we used a wrong schematic, we used a PIC16F887, 10kOhm pull up resistors, PICkit2 and we are using the same module as you guys..
Not one of the programs is working for us.. Maybe we used a wrong schematic, we used a PIC16F887, 10kOhm pull up resistors, PICkit2 and we are using the same module as you guys..
-
- Posts: 10
- Joined: Fri Nov 09, 2018 9:16 pm
- Has thanked: 1 time
Re: I2C LCD printing strings
Hi Jorgen,
We didn't solder the pad is this really necessary? Isn't the default address 0x4E if we didn't solder the pad?
And what microcontroller and other components are you guys using because our LCD is still not doing anything.
We didn't solder the pad is this really necessary? Isn't the default address 0x4E if we didn't solder the pad?
And what microcontroller and other components are you guys using because our LCD is still not doing anything.

-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: I2C LCD printing strings
Hi.
For me, when i use these module with the display, it is nessesary to solder them, otherwise it doesn`t work for me.
Br. Jorgen
For me, when i use these module with the display, it is nessesary to solder them, otherwise it doesn`t work for me.
Br. Jorgen
Re: I2C LCD printing strings
With NO jumper on A0, A1 , A2 the address is x3F (or 63 decimal) - this works 100% for me.
-
- Posts: 10
- Joined: Thu Jan 29, 2015 11:45 am
- Been thanked: 3 times
Re: I2C LCD printing strings
The basic adresses of this expander are found here. And for the record, it does work with the LCD I2C (LCM1602) component that you can find in Flowcode 8.
If there are no bridges on the expander board, then the adress lines A0 to A2 are high. In my case this meant that the standard adres is 0x3F (63 decimal).
I'll post an image here of the 'differences' in expanders. (PCF874T or PCF8574AT, where I use the last one)
If there are no bridges on the expander board, then the adress lines A0 to A2 are high. In my case this meant that the standard adres is 0x3F (63 decimal).
I'll post an image here of the 'differences' in expanders. (PCF874T or PCF8574AT, where I use the last one)
- Attachments
-
- FVVYTFXIJVPTOD4.LARGE.jpg (65.65 KiB) Viewed 12364 times
Re: I2C LCD printing strings
Hey
Can anyone help?
The LED flashes three times. I can't get the i2C display to work with the 18F4455.
I put the hex file in the microcontroller with a pickit2.
Thanks in advance
Can anyone help?
The LED flashes three times. I can't get the i2C display to work with the 18F4455.
I put the hex file in the microcontroller with a pickit2.
Thanks in advance
- Attachments
-
- schematic.jpg (116.26 KiB) Viewed 10529 times
-
- display.jpg (182.94 KiB) Viewed 10529 times
-
- i2c_LCD_18F4455.fcfx
- (8.18 KiB) Downloaded 279 times
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: I2C LCD printing strings
Hi,
You schematic shows a 20Mhz clock your SW is setup for 48Mhz ,and the configuration looks suspicions to me
if this is the actual state of your project 20Mhz clock the LCD will never work as the baud rates are incorrect
You schematic shows a 20Mhz clock your SW is setup for 48Mhz ,and the configuration looks suspicions to me
if this is the actual state of your project 20Mhz clock the LCD will never work as the baud rates are incorrect
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: I2C LCD printing strings
Hi abcde!
First of course what Qmsar said, the config have to be correct, otherwise it won´t work
Always when I use the I2C Backpack display, I solder the pad A0 + A1 + A2 and adjust the contrast. And I always have succes with this.
Br jorgen.
First of course what Qmsar said, the config have to be correct, otherwise it won´t work

Always when I use the I2C Backpack display, I solder the pad A0 + A1 + A2 and adjust the contrast. And I always have succes with this.

Br jorgen.
Re: I2C LCD printing strings
thanks for your response.
If I change in flow code 48MHZ to 20 MHZ then the LED flashes too fast and the display still does not work.
If I use 48 MHz de led flashes correct.
Indeed I think the error is in entering the "project options"
But I can't find the error.
If I change in flow code 48MHZ to 20 MHZ then the LED flashes too fast and the display still does not work.
If I use 48 MHz de led flashes correct.
Indeed I think the error is in entering the "project options"
But I can't find the error.
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: I2C LCD printing strings
163/5000
When I use the i2c board with an arduino, I don't solder the jumpers either and then the board will work.
That's why I don't think the problem lies with the board.
I suspect the problem lies with the microcontroller setting.
When I use the i2c board with an arduino, I don't solder the jumpers either and then the board will work.
That's why I don't think the problem lies with the board.
I suspect the problem lies with the microcontroller setting.