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
Slow I2c display! SOLVED!
Moderator: Benj
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- 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!
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
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
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: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: Slow I2c display!
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
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
- 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!
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.
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.
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
- 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!
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.
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.
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: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: Slow I2c display!
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
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
- 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!
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.
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.
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: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: Slow I2c display! SOLVED!
Hi Ben!
Thank´s for your explanation. and the correction. I could imagine it was a litte bug
Br
Jorgen
Thank´s for your explanation. and the correction. I could imagine it was a litte bug

Br
Jorgen