Ah! Thanks Dave!
So, what happens when you have more than 1 I2C device?
Do you have only one pair of pull-ups on the mcu, or one pair on each device?
Robert
![]()
Ah! Thanks Dave!
So, what happens when you have more than 1 I2C device?
Do you have only one pair of pull-ups on the mcu, or one pair on each device?
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Demon, Thats the beauty of an open collector buses is there can be an unlimited number of devices connected. Any device can respond to a command and any device can be the master. Over current collisions are avoided by there only being 1 set of pullup resistors that source the current to the bus. If 2 devices try to talk at the same time there is no excessive current drawn. Therefore there needs to be a standard protocol that is used in the communications scheme. I have had more than 32 devices on a single bus in the past without any problem. The resistors are sized by the time constant to clear the ground condition produced by the device that is talking on the bus. Therefore to talk at higher speeds the pullups need to be smaller in size to enable more source current to the bus to clear the ground condition.
Dave Purola,
N8NTA
Last edited by Demon; - 4th October 2016 at 18:05.
Okaaaay...
So that begs the question, how do we calculate the resistor size?
The manual says 4.7K resistors, but I suspect that is an 'average'.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Demon, What you need to do is use an oscilloscope and look at the SDA line as well as the SCK line. However the SDA line is of more importance due to the fact that any device on the bus can drive it. Usually there is only 1 master and it generates the clock for the slaves. With the maxumum devices on the bus and the longest bus lines, opertaing at your maximum speed, make sure that the SCL and SDA lines are not distorting the waveform. If the waveform is rounded then decrease the resistance in 100 ohm increments until the waveform edges look pretty square. Be carefull not to go below about 1K ohm as that would be 5 ma. of current draw. Some devices out there can't pull down much mode than that.
Dave Purola,
N8NTA
Last edited by Demon; - 4th October 2016 at 18:05.
Bookmarks