0
\$\begingroup\$

I am currently working with a wired I2C bus system consisting of 6 individual bus lines with 4 slaves on each. They are currently all connected to one I2C bus and for each slave i add the bus becomes significantly slow.

I lately got the idea of adding a 8 channel I2C switch with the objective of boosting the bitrate in my system. Unfortunately i am not quite sure if this will solve my problem. The idea was to connect the 6 individual bus lines to one channel on the I2C switch and have the I2C master switch between each individual line in order to reduce the amount of slaves connected simultaneously. So instead of calling out to all 24 slaves i will instead take them in chunks of 4 at a time.

The question is, will this give me a higher bitrate or will it slow it further down due to the extra data that has to be passed to the I2C switch?

The master is a RPi2 and the slaves are ATmega32.

Datasheet: http://www.nxp.com/documents/data_sheet/PCA9548A.pdf

\$\endgroup\$
2
  • \$\begingroup\$ Could you specify what devices you use for master and slaves? \$\endgroup\$
    – Dejvid_no1
    Apr 8, 2015 at 6:52
  • \$\begingroup\$ @Dejvid_no1, this has been added to my post. \$\endgroup\$
    – JavaCake
    Apr 8, 2015 at 6:54

2 Answers 2

1
\$\begingroup\$

It's hard to say. If you are running in to rise time issues due to the capacitance on the line, then segmenting the bus will alleviate this issue. However, you will pay a penalty in terms of the switch configuration overhead. You'll have to do a usable bandwidth calculation for both cases and see which one is better - raw bit rate for one, bit rate times efficiency for the other.

\$\endgroup\$
1
  • \$\begingroup\$ As you mention i am also afraid that it will create significant overhead with the switch. Another direction i have been looking which will introduce some more complexity is a microcontroller with 6*I2C/TWI channels. For now i can gain a bit more speed by dividing the 6 buses on the 2*I2C channels that the RPi2 has to offer. In the long run i would wish for a better solution as i will extend the bus with 20 more slaves. \$\endgroup\$
    – JavaCake
    Apr 8, 2015 at 7:40
0
\$\begingroup\$

It will slow it down.

If I understand correctly you have 24 devices connected to the same bus. Since they all are slaves none of them can initiate a transaction, thus the bottleneck is the fact that you have 24 devices hooked to the same line, and not them talking at the same time.

To solve your problem you should use multiple buses, I think the RPi has at least two, or use a smarter switch that can retrieve data from various slaves at the same time and transmit it to the RPi at a much higher rate.

\$\endgroup\$
4
  • \$\begingroup\$ I don't want to introduce a higher complexity. But would it perhaps be ideal to have 5 individual microcontrollers to communicate with each individual bus and sending the data to the RPi2 via SPI? Atleast the SPI will not be the bottleneck. I have been looking for a better switch but have not found any quite yet. \$\endgroup\$
    – JavaCake
    Apr 8, 2015 at 6:58
  • \$\begingroup\$ Sorry, 6 microcontroller not 5. \$\endgroup\$
    – JavaCake
    Apr 8, 2015 at 7:20
  • \$\begingroup\$ adding microcontrollers might work, I don't see how you can call it "no higher complexity". If you don't want higher complexity you probably should make do with what you have. \$\endgroup\$ Apr 8, 2015 at 7:32
  • \$\begingroup\$ You might have understood me wrong, but i see the 6 extra controllers as a higher complexity. Fortunately it is possible to find ARM controllers with 6*I2C channels, but even this may get a bit of out hand. \$\endgroup\$
    – JavaCake
    Apr 8, 2015 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.