i2c spped

Started by gvi70000, February 29, 2016, 06:50:34 pm

Previous topic - Next topic



Where can i set the i2c speed?
Is there a limit for the no of devices connected to an I2C port?


For I2C speed setting, see this thread: https://www.olimex.com/forum/index.php?topic=1779.0.

For limits, it's a bit complicated - I2C itself can address up to 127 devices (for most implementation, the real limits are somewhat lower) , but the bus driver (the "physicval layer") can source/sink only limited currents and so serve only limited number of devices, especially if each one has own pull-up resistors. So it depens on type of devices themselves and also on overall bus lenght (and impedance/capacitance). I'm not sure abot the A20, but most SoC can serve about 3-5 devices with no problems (as long as the bus is physically not very long), but if you want more devices (up to the limit and for multiplexers even more), ther are I2C bus buffer/extenders/repeater ICs.


Thank you for your reply.

I have an issue detecting more than 2 I2C devices on one bus. I have a board with a DS1307 + MPU9150 + MS5611 and in this case the MS5611  is not detected. If i remove it and place it on a different port is working. The same behavior i have on a Sparkfun 9DOF stick, only the magnetometer and gyro are detected, the accel is not.
I have tested the boards also on an arduino micro and a RPI and all the cips are detected.

I have removed the pull up for A20 micro 4Gb board when i did the testing.

The only question that remains is if the I2C sunxi parch is applied for 3.4.49 core, but all the chips are capable to runt ah higher I2C speeds.


March 02, 2016, 08:05:02 am #3 Last Edit: March 02, 2016, 08:36:54 am by gvi70000

I just tested the I2C at different speeds....it turns out that the hardware is ok, is the A20-OLINUXINO-TOOLS that dosent work, no address 0x7x is seen by the tool


i have i2c running at 1Mhz without any problems on multiple boards. You have to change the kernel config for this and recompile it, because the kernel limits are set to 400kHz for all i2c busses.

Also you have to put 1.8kOhm pullup resistors in parallel to the 2.2kOhms pullups on the A20 to get it working. I had it working on cable length up to 5m but you have to use low impedance cables for this. Up to about 0.5m it (almost) doesnt matter which cables you use.


Thank you for your reply Soenke,
I have seen one of your post here...
As i said before, i thought in a HW fault, but it turns out the the I2C tool for android provided by Olimex is not working correctly. It was my fault that i did not tried earlier to use a Linux image to test the I2C.

I will look in to the apk source and try to figure it out now that i know the hardware is ok.