# stm32 - i2c communication fail after disconnecting oscilloscope probe

I am trying to communicate with TCS34725 module with NUCLEO-F401R board. The first I tried is to read out ID register of TCS34725, which should be 0x44, to check the connection. Everything works fine when I have my scope probe (gain is x10) is connected to SCL/SDA Line:

BUT, whenever I disconnect my probes (both or one of them), the HAL_I2C_Mem_Read function call will timeout and readout will be 0 not 0x44. I have no idea on how to fix this, so I am here for help.

Here is my hardware connection:

The TCS34725 Module is a product by DFROBOT, the schematic is (Source):

My code is:

#define TCS34725_ADDRESS          (0x29 << 1)
#define TCS34725_ID               (0x12)
extern I2C_HandleTypeDef hi2c1;

}

uint8_t TCS34725_Init(void) {
}


Here is my current hardware setup, I have changed another breadboard and redo my wiring to make sure nothing is loose. But same problem still exists.

• That sounds like some parasitic effect that could be quite hard to find remote. Can you show a photo of where exactly you place your probes? Maybe there is some loose contact and by pressing the probe tip against it, it works? – jusaca Feb 4 at 6:51
• All those wires in space. Interconnected by way of that proto board. Kind of a nightmare. That is probably why it doesn't work. A lot of times when a scope probe makes something work, you can achieve the same affect by putting a capacitor where the probe was. Like a 15pF or 22pF. – mkeith Feb 4 at 8:27
• @jusaca I deliberately suggested resistors at the almost minimum end of the scale to see if it is even about that. It is within I2C specifications and the IO driver specs of the chips. 1k8 or 2k2 should be still strong enough, with less current. – Justme Feb 4 at 9:11
• If you have to go board-to-board with I2C, and if you are able, it is helpful to use separate grounds for each signal, and twist the wires together. So you twist SDA with one ground wire and twist SCL with another ground wire. It is kind of a "pseudo differential" treatment of the wires. – mkeith Feb 4 at 9:11
• @mkeith Either that, or twisting VCC with SDA for less wires. Simply deattaching the wires from each other so SDA and SCL have less coupling should work too. Or using the suggestion from I2C specs, i.e. have wiring like SCL-GND-VCC-SDA in the flat cable. – Justme Feb 4 at 9:30