Mod's
- Details
- Parent Category: Mod's
Arduino I2C multiple slaves
Connecting more than 1 I2C device to an Arduino is simple, if you follow some basic rules.
I2C Basics
The I2C bus is designed to be a multipoint serial connection system.
So it was always intended to use with multiple devices.
But how can they share the same Pins on the Arduino?
Here is a simple layout:
The µC Master is the Arduino, with multiple I2C Slaves connected over the SDA and SCL Lines.
The Trick is within the 2 pullup Resistors Rp!
I2C pullup resistors
They are needed to help the devices with getting the slew rates it needes. Depending on the i2c bus speed different rise times are needed.
In Standard mode with 100khz a maximum rise time of 1000ns is ok, for fast mode with 400khz the rise time should not exceed 300ns.
If want to just get it going, take 4.7k and it will work when you have just 1 slave.
But we want to make it right or?
The size is depending from the total capacitance in the circuit, so you will have to look to the datasheets and sum up the capacitance to get our Cb, next look up the formula:
Rp(max) = tr/0.8473 x Cb
Where tr is our allowed rise time for the signal, take this with 1µs or 300ns depending on your bus speed.
See also the TI Application note: SLVA689 I2C Bus Pullup Resistor Calculation
So what? What happens when the resistor is wrong?
I2C wrong pullup resistor
if the resistor is to high the signal rises to slow, that will cause missing bits -> trouble.
But also to low values get you trouble, they will draw too much current, do not go below 1k.
Good practice is to first make the calculations, then hook up a oscilloscope and verify your values.
I2C bus slave address conflict
Every slave must have a unique address, so check your datasheets and ensure that the devices all have unique addresses!
I2C Bus with mixed Voltages
mixing 5V and 3V devices is possible, but dont just connect them together!
(AN97055)
It needs a bidirectional level shifter, common practice is to use Mosfets with clamping diodes.
Take a look at the Application Note 10441 from NXP it is about "Level shifting techniques in I2C-bus design"
Also the old Application Note AN97055 "Bi-directional level shifter for I2C-bus and other systems." is a more in depth read about it.
Sources:
Silabs AN0011 I2C Master and Slave Operation
TI SCAA106 Troubleshooting I2C Bus Protocol
DSScircuits Effects of varying I2C pullup resistors
NXP AN10441 Bidirectional level shifter for I2C
Phillips AN97055 Bi-directional level shifter for I2C-bus and other systems
- Details
- Parent Category: Mod's
Marantz CD-73 Kondensator tauschen
der Marantz CD-73 (Baujahr 1983!) ist immer noch einer der am besten klingenden CD Spieler den es gibt.
Die Bauqualität ist erstaunlich, der Laser wird wohl auch die nächsten 30 Jahre leben, aber die Kondensatoren nicht...
Dieser hier klingt aber grauenhaft, es brummt stark, nichts von wohlklang zu hören! Ein bekanntes Problem, die Kondensatoren sind eingetrocknet.
- Details
- Parent Category: Mod's
Marantz 1090 Phono Disable
The vintage (build year 1978!) Marantz 1090 amplifier is equipped with 4 regular inputs and 2 phono inputs. We need more regular inputs, so the phono stage was shortcut to get 6 regular inputs, yeah!
To see how its done, click "Weiterlesen"
- Details
- Parent Category: Mod's
Pizza Stahlplatte
eine Stahlplatte um darauf Pizza zu backen, selbstgemacht und seeeeeehr lecker
in Modernist Cuisine zeigt Nathan Myhrvold wie man mit dem Baking Steel besser als dem Schamottstein Pizza usw backt.
Serious Eats hat es bestätigt, auf Stahl Backen ist besser als auf Stein!
Das Baking Steel kann in den USA gekauft werden, in Europa nicht für einen normalen Preis zu bekommen
Deshalb, hier ein Weg wie man so eine Stahlplatte selbst herstellen kann
Weiterlesen drücken um die Herstellung zu sehen
- Details
- Parent Category: Mod's
Garderobe aus Werkzeug
Schwedisch kann doch jeder
Geschmiedet aus Ringgabelschlüsseln, montiert auf einer Küchenarbeitsplatte in roher Holzoptik
Alle Arbeitsschritte seht ihr wenn ihr auf weiterlesen klickt!
Subcategories
Elektronic's Article Count: 27
Mods aus dem Bereich Elektronik
Technik Article Count: 24
Technikrelevante Dinge die sonst nirgends passen
Auto Article Count: 17
Mods rund ums Auto
Arduino Article Count: 25
Alles rund um Arduinos
RC Article Count: 2
Mods rund um Ferngesteuertes!