Slow I2c display! SOLVED!

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

Moderator: Benj

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

Slow I2c display! SOLVED!

Post by jgu1 »

Hi!

ARDUINO MEGA R3 And I2c

In Fc7 the I2c dislpay is very slow. I remember the same issue in FC6 and Ben make a change in the CAL file, and the I2c display get really fast.

http://www.matrixtsl.com/mmforums/viewt ... i2c#p69799


When I do the same in FC7 it doesn´t help in FC7

In the AVR_CAL_FLASH.c File // delay_ms(10);


Can anybody help please.

Br
Last edited by jgu1 on Tue Oct 18, 2016 4:23 pm, edited 1 time in total.

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: Slow I2c display!

Post by Benj »

Hello,

Hopefully the following will help.

The display itself may have a property saying "Stop Delay", try setting this to No.


If there is no such property then let me know which display component you're using and try the following.

1) In Flowcode click View -> Component Debugger
2) In the new window check the "Expose full component tree" tickbox
3) At the top of the Properties window is a drop down, click the drop down and select the cal_i2c component within the display component
4) Change the "Stop Delay" property to No
5) In the component debugger window uncheck the "Expose full component tree" tickbox

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

Re: Slow I2c display!

Post by jgu1 »

Hi Ben!

Thank´s

Sorry, your advice it doesn´t make make any change in the speed. Full speed in simulation, but in real world very slow. I was able to see and change the yes and no in properties for display.

The same program in ver.6 is least twice the speed as in FC7. Hope you have an another tip.

Br

Jorgen
Attachments
I2C Speed.fcfx
(6.27 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: Slow I2c display!

Post by Benj »

Hello Jorgen,

There's a few things you can do to increase the speed.

1) The I2C bus speed is currently set to 100KHz
2) The Stop Delay property didn't seem to make it through to the CAL I2C component
3) Your currently using the software I2C, hardware will probably be faster.

To change the I2C bus speed and stop delay you need to get to the I2C CAL component.

1) In Flowcode click View -> Component Debugger
2) In the new window check the "Expose full component tree" tickbox
3) At the top of the Properties window is a drop down, click the drop down and select the cal_i2c component within the display component
4) Change the Baud Select property to 1MHz and the Stop Delay property to No
5) In the component debugger window uncheck the "Expose full component tree" tickbox

I have done the stop delay and baud rate change for you in the attached program. I'm investigating now why the stop delay change didn't go through and why the default baud is so low.
I2C Speed.fcfx
(6.27 KiB) Downloaded 238 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: Slow I2c display!

Post by Benj »

Here's an updated component with the defaults: Stop Delay Off and Baud 1MHz.

I've also fixed the stop delay property not being copied correctly to the internal CAL I2C component.

To apply the fixed component simply copy the attached file to your "Flowcode 7/Components" folder and restart Flowcode.
lcd_I2C.fcpx
(25.91 KiB) Downloaded 302 times

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

Re: Slow I2c display!

Post by jgu1 »

Hi Ben!

Perfect. It work 100% ok. Full speed on the display. I am also able to use the on/off function.

But what is the meaning with switch on and off?

Thank´s.


Br.

Jorgen

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: Slow I2c display! SOLVED!

Post by Benj »

Hi Jorgen,

The "Stop delay" property is there as some devices tend to lock up if you don't have a 10ms delay in between multiple I2C transactions.

On these devices it is better the I2C runs slowly rather than deadlocking the system.

We switch the delay on by default in most cases just so it works reliably on all devices.

If the user notices the I2C being slow then they can play with the property to speed up the bus. In doing so they will be aware that if the lock up happens then they hopefully also know how to remove it again.

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

Re: Slow I2c display! SOLVED!

Post by jgu1 »

Hi Ben!

Thank´s for your explanation. and the correction. I could imagine it was a litte bug :lol:

Br

Jorgen

Post Reply