1
\$\begingroup\$

I'm experiencing some issues while probing a problematic I2C bus on the oscilloscope.

We want to interface several TLV493D-A1B6, with a STM32L4 (we are working as well on STM32F4 and have the same issues).

The STM32L4 has 4 I2C FM+ (1Mbit/s) bus. We want to use the 4 of them in order to communicate with a total of 12-16 sensors, hence 3-4 sensors per bus.

We achieved 4 sensors on the same bus as well as having 1 sensor on each one of the 4 bus.

However, we are not able to interface more sensors (i.e. 4 sensors on 4 bus or even 1 sensor on 3 bus and 2 sensors on the 4th bus). Some bus starts and continue working, some other don't start, some start and stop after couple of seconds, these behaviours being random.

While probing the bus on the oscilloscope I noticed what looks like heavy ringing when SCL (or SDA) goes from HIGH to LOW and I am wondering if it can be the source of the problem. Here you can see this ringing on the SCL line :

SCL going HIGH to LOW when 1 sensor on the bus

SCL going HIGH to LOW when 3 sensors on the bus, other room

As you can notice, the ringing seems to be less important on the second picture. It has been taken the day after the first one, in a seperate room (different outlet for the oscilloscope) and while the first pic shows the signal with one sensor on the bus, the second one depicts the signal with 3 sensors on the bus.

Some information on the I2C bus:

  • Frequency : 1 Mbit/s

  • Capacitance : the capacitance of the bus has been determined by measuring the rising time of the signals. It has been determined that one bus has a capacitance ranging from 50 pF for one sensor to 100 pF for 3 sensors.

  • Pull-up resistors : 1,2 kOhms (other values have been tried, ranging from 600 Ohms to 2,2 kOhms. Lowering the value seems to improve a bit but the timing has been checked and 1,2k seems correct).

  • Termination : 33 Ohm series resistors have been used on each line.

  • Power supply : several power supply schemes has been tried for the sensors including an isolated bench power supply or the same power supply as the MCU.

  • The I2C lines run through relatively short cables and bread board. The capacicance has been checked and it's apparently not the source of our problem.

I am not the one responsible for the firmware but I do know that we are using DMA on the MCU in order to have 4 I2C FM+ running at the same time.

Some ideas we had but we can't clarify :

  • The increasing number of sensors is responsible for a over usage of the power supply.
  • The ringing comes from bad probing and is not happening when the the signals are not probed. It has been noticed that probing the signal usually leads to worst results.

Does anybody have already experienced a similar behaviour with I2C and/or does anybody have any idea to improve our set up ?

Again, what sounds strange to me is that the set up works with 4 sensors on 1 bus, it works as well with 4 sensors on 4 different busses but we are stuck when trying to go further, the goal being 12-16 sensors on the 4 bus.

PS : I can't post a schematics of our set up right now but I'll edit my post as soon as I can.

\$\endgroup\$
  • 1
    \$\begingroup\$ Do post a schematic. How do you manage the 4 chips being on same bus? They only have two different addresses so you can't have more than 2 chips on the same bus segment. Also you need to power them up correctly to give different addresses to them or they will conflict. Do you have an issue at 400kHz? Trying at Fast-Mode I2C speed needs no special FM+ tricks on the STM32. The TLV493D-A1B6 I2C protocol looks somewhat weird, they suggest using some non-standard protocol the STM32 might not be compatible with. It might work with standard protocol but just with more overhead. \$\endgroup\$ – Justme Dec 13 '18 at 18:16
  • \$\begingroup\$ The schematics will be posted in a couple of hours. Indeed we are following the power-up sequence in order to give them different addresses. This is no problem at 400 kHz. At 400kHz, we have up to 8 sensors on 3 different bus without any problem. LDOs with enable pin are used to power-up each sensor individually in order to follow the start-up sequence described in the datasheet. What do you think is "non-standard" in the protocol ? \$\endgroup\$ – J. K. Dec 14 '18 at 9:01
  • \$\begingroup\$ I mean, right now we start-up the sensors one by one by hand. The LDOs are used in the 400kHz version of the project. For the 1MHz version, we plug the sensors one by one once the previous one has been initialised (address configured, etc) \$\endgroup\$ – J. K. Dec 14 '18 at 9:17
  • \$\begingroup\$ I agree, that riging is due to poor probing. Do you use attenuating (1:10) probe? \$\endgroup\$ – Eugene K Dec 15 '18 at 18:34
  • \$\begingroup\$ Thank you @EugeneK. I am not using any particular probe which is why I think it is due to bad probing. If the ringing happens only when the signal is probed, we're left with another unknown issue... \$\endgroup\$ – J. K. Dec 17 '18 at 9:01
0
\$\begingroup\$

Wow, that's an ugly waveform. Remove the 33ohm series resistors. Use stronger pullup resistance. 1.2k might seem correct, but the slow rise time indicates that it's too high.

Make sure there's the lowest possible resistance between the ground of each device.

\$\endgroup\$
  • \$\begingroup\$ Isn't the 33ohm resistor supposed to reduce the effect of ringing ? It is adviced by the datasheet of the sensor. I agree that 1.2k is a bit high but how do you explain that it works fine with 4 sensors on one bus with the same value ? Thank you. \$\endgroup\$ – J. K. Dec 14 '18 at 9:06
  • \$\begingroup\$ The series resistor is probably to protect the device from overcurrent. \$\endgroup\$ – Annie Dec 15 '18 at 4:12
  • \$\begingroup\$ It may have lower total capacitance in the other configuration; hard to say. \$\endgroup\$ – Annie Dec 15 '18 at 4:14
  • \$\begingroup\$ According to my measurements, the total capacitance increase ith the number of sensors. It starts from around 50 pF with only one sensor and goes up to 100 pF with 4 sensors which sounds normal. I think the slow rise time is not the issue here as it works for 4 sensors (a higher capacitance) hence an even slower rise time. I think we are way above and below the logic thresholds of both the sensor and the STM32. I will give it a try in the next days and I'll come back to you. Thank you for your answer ! \$\endgroup\$ – J. K. Dec 17 '18 at 8:54
  • \$\begingroup\$ I thought the series resistor was an overcurrent protection as well but I've read low value series resistor on digital lines can reduce reflections of the signal and ringing. It makes me think of impedance matching. Can a bad impedance matching be the source of my issue ? \$\endgroup\$ – J. K. Dec 17 '18 at 8:59

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.