I2C LCD printing strings

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

I2C LCD printing strings

Post by Thibault666 »

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

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: I2C LCD printing strings

Post by keejay »

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.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: I2C LCD printing strings

Post by jgu1 »

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.

Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

Re: I2C LCD printing strings

Post by Thibault666 »

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.

Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

Re: I2C LCD printing strings

Post by Thibault666 »

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.

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: I2C LCD printing strings

Post by keejay »

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.

User avatar
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

Post by Benj »

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.

Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

Re: I2C LCD printing strings

Post by Thibault666 »

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!

Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

Re: I2C LCD printing strings

Post by Thibault666 »

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 233 times

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: I2C LCD printing strings

Post by keejay »

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 263 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: I2C LCD printing strings

Post by jgu1 »

Hi!

Why doesn´t you use the I2C component, maybe I have misunderstanding something? If I have forget this please. :D

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 213 times

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: I2C LCD printing strings

Post by keejay »

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

Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

Re: I2C LCD printing strings

Post by Thibault666 »

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..

Thibault666
Posts: 10
Joined: Fri Nov 09, 2018 9:16 pm
Has thanked: 1 time
Contact:

Re: I2C LCD printing strings

Post by Thibault666 »

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. :(

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: I2C LCD printing strings

Post by jgu1 »

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

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: I2C LCD printing strings

Post by keejay »

With NO jumper on A0, A1 , A2 the address is x3F (or 63 decimal) - this works 100% for me.

theopieleke
Posts: 10
Joined: Thu Jan 29, 2015 11:45 am
Been thanked: 3 times
Contact:

Re: I2C LCD printing strings

Post by theopieleke »

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)
Attachments
FVVYTFXIJVPTOD4.LARGE.jpg
FVVYTFXIJVPTOD4.LARGE.jpg (65.65 KiB) Viewed 10149 times

abcde
Posts: 3
Joined: Fri Feb 28, 2020 2:33 pm
Contact:

Re: I2C LCD printing strings

Post by abcde »

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
Attachments
schematic.jpg
schematic.jpg (116.26 KiB) Viewed 8314 times
display.jpg
display.jpg (182.94 KiB) Viewed 8314 times
i2c_LCD_18F4455.fcfx
(8.18 KiB) Downloaded 134 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: I2C LCD printing strings

Post by QMESAR »

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
p2.jpg
p2.jpg (23.46 KiB) Viewed 8301 times
p1.jpg
p1.jpg (36.58 KiB) Viewed 8301 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: I2C LCD printing strings

Post by jgu1 »

Hi abcde!

First of course what Qmsar said, the config have to be correct, otherwise it won´t work :wink:

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. :D

Br jorgen.

abcde
Posts: 3
Joined: Fri Feb 28, 2020 2:33 pm
Contact:

Re: I2C LCD printing strings

Post by abcde »

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.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: I2C LCD printing strings

Post by jgu1 »

Have you solder the A0 A1 A2 jumper on the I2C board?

Jorgen.

abcde
Posts: 3
Joined: Fri Feb 28, 2020 2:33 pm
Contact:

Re: I2C LCD printing strings

Post by abcde »

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.

Post Reply