Page 1 of 1
Slow I2c display! SOLVED!
Posted: Sat Oct 15, 2016 7:46 pm
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
Re: Slow I2c display!
Posted: Mon Oct 17, 2016 1:09 pm
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
Re: Slow I2c display!
Posted: Mon Oct 17, 2016 7:42 pm
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
Re: Slow I2c display!
Posted: Tue Oct 18, 2016 12:05 pm
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.
Re: Slow I2c display!
Posted: Tue Oct 18, 2016 12:10 pm
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.
Re: Slow I2c display!
Posted: Tue Oct 18, 2016 4:22 pm
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
Re: Slow I2c display! SOLVED!
Posted: Tue Oct 18, 2016 5:10 pm
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.
Re: Slow I2c display! SOLVED!
Posted: Tue Oct 18, 2016 8:51 pm
by jgu1
Hi Ben!
Thank´s for your explanation. and the correction. I could imagine it was a litte bug
Br
Jorgen