I have noticed a number of topics, and messages within topics, that discuss the problems encountered while trying to maintain successful communication with various i2c devices.
Today I took a look at the datasheet for the Texas Instruments TCA9548A, 1 to 8 i2c buss multiplexer and noticed the following points of fact:
- There are two possible communications modes using i2c:
- “Standard” mode, which uses a 100kHz clock.
- “Fast” mode, which uses a 400kHz clock.
- The maximum capacitance of the entire buss path, including parts, wiring, PCB traces, pins, Acts of God, (etc.), is 400pF when running in “fast” mode.
Viz.: Taken from the Texas Instruments TCA9548A datasheet: (which I have attached)
tca9548a.pdf.txt (2.9 MB) (remove the “.txt” at the end)
It is important to note that 400pF is a very small value; casual body/finger capacitance can easily exceed that.
If we take into account the length of the Grove connector wires, insulation, proximity to each other and other parts of the 'bot/circuit/chassis, the ultimate length of all this wiring and the PCB traces, the fact that one single i2c port can be, and often is, shared among a number of devices, and so on, (etc.), I would not be surprised if the total wiring and circuit capacitance was in the significant fractions of a μF range. (1μF = 1,000,000pF)
It should also be noted that 400kHz is considered part of the medium-wave radio spectrum, just below the AM broadcast band. (The intermediate frequency for a standard AM receiver is 455kHz, and the actual AM broadcast band starts at 535kHz.) Though abysmally slow by today’s multi-giga-hertz standards, it’s still a high frequency and demands out attention and respect.
This leads me to wonder which i2c mode is being used by the Raspberry Pi in general, and the Dexter software in particular. . .
Also, is this selectable? Can devices like the IMU or GPS operate at “standard” mode frequencies? Maybe this is something worth investigating?
Though we know that the Raspberry Pi appears to have problems with clock-stretching, is it possible that circuit capacitances could be screwing up rise and fall times to make things even worse?