i2c LCD problem

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

Moderator: Benj

andy.reynolds
Posts: 13
Joined: Fri May 18, 2018 3:42 pm
Contact:

Re: i2c LCD problem

Post by andy.reynolds »

Thanks for the new component to run the i2c LCD, I'm now trying to run it with a UNO but am having problems, it compiles, simulates and uploads to the board no problem but the board won't run the program.
I've tried a simple led blink before doing any lcd command and the led does blink but then the program seems to get stuck on the first lcd command and will do nothing until the board is reset, any ideas ?
If I put the "LCD start" at the beginning where it should be, that's where the program will halt and the LED won't blink.
Thanks Andy.
Attachments
UNOLCD.fcfx
(9.67 KiB) Downloaded 256 times

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 problem

Post by Benj »

Hello,

Do you have external pull up resistors on the I2C pins? Or have you enabled the internal pull up resistors? It could be clock stretching and the lack of pull up resistors that is causing the program to hang. Might also be worth trying the software channel to see if you have any more joy with this.

andy.reynolds
Posts: 13
Joined: Fri May 18, 2018 3:42 pm
Contact:

Re: i2c LCD problem

Post by andy.reynolds »

Thanks Benj
I can't see where to set the pull ups on those pins in flowcode...............
Andy

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: i2c LCD problem

Post by medelec35 »

Hi Andy,
I must confess, I don't know much about AVR so I could be wrong.
I believe to set an internal Pull-up, the relevant input pins have to be set high.
This could be done with a C code block.
Since I2C is using port C4 & C5, you could try a C code block at the very start with

Code: Select all

PORTC= PORTC|48;
What I would do if I was you would be to use an I2C sniffer.
That would help in two ways.

1) Will confirm that I2C hardware is connected correctly including pins and pull-up resistors.
2) Will display the address of I2C device.

If you scroll down, mnf posted about Arduino running the sniffer.
Martin

Post Reply