5
\$\begingroup\$

I'm doing a project where I'll have a lot of slave ATtiny's and one master controller (either an Arduino/ATMega or an mbed). I assume the ATtiny with it's low clock speed of 10MHz will be my bottleneck(using builtin oscillator). I'm needing to establish how feasible a design is by how fast I2C can go on an ATtiny. So, assuming everything is perfect, how fast can an ATtiny transfer data by I2C in kilobytes per second? Also, what kind of clock speeds would we be talking about in Hz?

\$\endgroup\$
3
\$\begingroup\$

Most devices with I2C capability nowadays can handle the two lowest nominal datarates which are 100kbps and 400kbps.
The ATTiny seems to be capable of both of these according to this app note.

So assuming everything is perfect you will be able to transfer 400,000 / 8 = 50 kilobytes per second. Allowing for overheads like addressing/negotiation it will probably be a little under this. If you want an exact figure (for your particular application) it wouldn't be hard to set a little test up using a timer to time sending x bytes.

\$\endgroup\$
5
\$\begingroup\$

As Oli said, 100 kbits/s and 400 kbits/s are "standard" IIC bus speeds. However in practise in most cases the IIC bus speed is limited by the signal rise times. Both lines are passively pulled high, and these pullups are limited to 3 mA, so the rising edges will take some time.

Real IIC chips are only obligated to overcome 3 mA of pullup current to get a line below the maximum logic low threshold. However, if you know exactly what's connected to the bus and what pulldown capability it really has, you can use stiffer pullups and therefore run faster. Check the current sink capabilities of the output pins used to drive the IIC bus on the micros you are using. Most likely they can sink significantly more than 3 mA. With stiff pullups and a short IIC bus all on the same board, you should be able to get up to 1 Mbit/s or more since IIC is ultimately synchronous.

Experiment with the parts you have and look at the waveforms on a scope to see what they are capable of. Remember, this is only valid if all devices on the bus can do this. If you hook up a dedicated IIC chip, like a EEPROM for example, then you should stick to the standard.

\$\endgroup\$

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.