I2C signal quality and SDA/SCL microcontroller protection

Thread Starter

josmA

Joined Jun 12, 2019
35
Hello,

I would like to ask you two questions in one post, as they are related to I2C and the same PCB.

1) I2C Microcontroller protection. I am using a development board to communicate by I2c with my custom PCB, where there are I2C expanders and power monitors. The problem is that after some time using it, usually days or weeks (not using it every day), the I2C port of the development board stops working. I still can use the dev. board and I2C with other pins, but not the original ones. I didn't give much importance at first, but recently, I have used another custom PCB to communicate with the first custom PCB, getting the same result, but this time the PCB is much more expensive than the dev. boards.
Do you know what can be the reason? Do I need to protect it with series resistors or clamp diodes? If so, could you give more details? I can't risk blowing up another PCB.

2) Quality of the signal. The communication works because I can enable signals and read data from power monitors, but I wanted to double-check whether the signal shown below with the oscilloscope is a typical one. There are like incompletes pulses or not sure what it is. Could you please help with this?
DS1Z_QuickPrint23.png

I have to design a new iteration of PCBs, so I would like to correct the mistakes done so far.

Many thanks in advance
 

Deleted member 115935

Joined Dec 31, 1969
0
What is causing those "Spikes" on the SDA line ?
they should not be there, and although not the problem, could be an indication of whats causing the problem.

Try putting the scope probe on X10 , not X1, as the higher impedance offered by the X10 probe will load the circuit a lot less.

What is the I2C master ?
What is the circuit of what you have ? can you provide a schematic please,

What speed is this I2C ?

Can you provide a picture of the set up / hold time SCL to/ from a SDA transition please.
 

Thread Starter

josmA

Joined Jun 12, 2019
35
Hi Andrew,

Thanks for your reply.

The I2C master is the development board (during testing) connected with the slave PCB by wires. The PCB is a power management board, so there are some boost and buck converters, power monitors, I2C expanders... Sorry, I can't provide schematics. Using the dev. board as I2C master, just SDA, SCL and GND is connected to the slave PCB.

The speed of I2C is standard 100Khz. I don't know about those spikes, just to know that they shouldn't be there helps. I will send the timing once I get the chance to test it again.

Many thanks
 

Juhahoo

Joined Jun 3, 2019
215
Is SDA shared with other I2C devices or other digital ports? Looks like SDA signal is loaded and this load prevents Data signal to complete and only "spikes" occur.
 

Thread Starter

josmA

Joined Jun 12, 2019
35
Is SDA shared with other I2C devices or other digital ports? Looks like SDA signal is loaded and this load prevents Data signal to complete and only "spikes" occur.
Thanks for your reply. Yes, there are many I2C slaves, between power monitors and I2C expanders ICs, sharing the same bus, not other digital pins. What do you mean the signal is loaded?
 

Deleted member 115935

Joined Dec 31, 1969
0
Thanks for your reply. Yes, there are many I2C slaves, between power monitors and I2C expanders ICs, sharing the same bus, not other digital pins. What do you mean the signal is loaded?
I2C is an open collector bus,

the signal is driven low, but pulled up high

The rise time of those signals looks terrible,
what pull ups do you have on the I2C bus ?

The rise time of the signal, is affected by the amount of current the pull ups can supply, and the capacitance of the bus.

The longer and more winding the wires are, and the more loads you have on the bus, the higher the capatance
 

Juhahoo

Joined Jun 3, 2019
215
Is your I2C bus pulled up by resistors? is the picture from data in or data out from slave/master ?
Is your I2C bus address 8 bits? Can you communicate with the slaves, all of them ?
You obviously need stronger pullups, but the spikes concerns, pullup wont save that, its like bus is occupied when you try to access data. Is every slave with their own address?
 

Ian0

Joined Aug 7, 2020
3,463
Those waveforms look just like they should. Rise times are perfectly OK. If you want to run it any faster you'll need some stiffer pullups.
The spikes on SDA happen where the controller* stops driving the line and the peripheral* takes over. Note that the spikes happen immediately after the 8th data bit. Pretty much anything is allowed to happen during the low phase of the clock.

Is your I2C bus pulled up by resistors?
Yes, of course it is.

*we're not allowed to say "master" and "slave" any more. It's "controller" and "peripheral".
 

Juhahoo

Joined Jun 3, 2019
215
I hope these are useful.
I looked your photo set, your bus is obviously lacking proper pull ups, too much slave/master units on your bus adds capacitance and current pull is not enough to overcome it with the wanted speed. If you use internal pull ups add external ones around 1k-2k resistors to get additional boost.
Below is an example how the things should be, Just tune it so at least one thing is fixed.
1630600757430.png
 
Last edited:

Thread Starter

josmA

Joined Jun 12, 2019
35
Is your I2C bus pulled up by resistors? is the picture from data in or data out from slave/master ?
Is your I2C bus address 8 bits? Can you communicate with the slaves, all of them ?
You obviously need stronger pullups, but the spikes concerns, pullup wont save that, its like bus is occupied when you try to access data. Is every slave with their own address?
Yes, I am using 4.7KOhms reisstors. The signals are data out from the master.
Yes 8 bits.
There are a couples of devices with the same address (by mistake), apart from that one, I can communicate with all of them.
 

Thread Starter

josmA

Joined Jun 12, 2019
35
Those waveforms look just like they should. Rise times are perfectly OK. If you want to run it any faster you'll need some stiffer pullups.
The spikes on SDA happen where the controller* stops driving the line and the peripheral* takes over. Note that the spikes happen immediately after the 8th data bit. Pretty much anything is allowed to happen during the low phase of the clock.


Yes, of course it is.

*we're not allowed to say "master" and "slave" any more. It's "controller" and "peripheral".
Thanks. I agree with it, after some research, that kind of glitch after the ACK bit is normal.

Any idea about why the SDA pin stop working overtime. I suspect that this is happening when I power up or down the lab power supply.
 

Thread Starter

josmA

Joined Jun 12, 2019
35
Thank you everyone for your answers. I will try to tune the pull up resistor value to improve the quality of the signal.

What about my second question, protection of the microcontroller? This is more important to me, any idea why is it happening and how to avoid it?
For the moment, I am trying with 2 clamp diodes connected to the SDA line and 3.3v / GND, and a 100 ohm series resistor. I don't know yet if that will prevent damages overtime.

Thanks
 

Dexter232

Joined Jul 5, 2018
1
First just a general question: are your probes calibrated? This might influence the display of signal rise times...

From the given images i don't see any reason for your I2C drivers to fail.
Some suggestions:
- Maybe look at the signals over a longer period of time, and don't look at the protocol but at the peak to peak values
- Does the custom/slave board include power switching electronics, if so can you see any changes in the peak to peak values if they are active or inactive?
- If the defective development board, can you determine the defect. When using the same pins as digital IO what fails, when used as input, if used as output can it pull the line up and down?
 

Deleted member 115935

Joined Dec 31, 1969
0
Yes, I am using 4.7KOhms reisstors. The signals are data out from the master.
Yes 8 bits.
There are a couples of devices with the same address (by mistake), apart from that one, I can communicate with all of them.
You need to disable / change the address of the chips with the same address's.
do that before any thing else

How many loads do you have on the bus ?
what are the chips you have
 

Deleted member 115935

Joined Dec 31, 1969
0
Thank you everyone for your answers. I will try to tune the pull up resistor value to improve the quality of the signal.

What about my second question, protection of the microcontroller? This is more important to me, any idea why is it happening and how to avoid it?
For the moment, I am trying with 2 clamp diodes connected to the SDA line and 3.3v / GND, and a 100 ohm series resistor. I don't know yet if that will prevent damages overtime.

Thanks
What could cause I2C to be damaged ?

a) ESD, if you have boards that can be dis connected

b) driving a chips pin , when the chip is not powered,
i.e. if the peripheral is not powered and your driving the SDA / SCL high,

c) over voltage ,
i.e. if the two grounds are not the same, typically if one of the boards is un plugged, ground should connect first

protection

a) Use an I2C buffers

b) Use clamp diodes ( adding a series resistor will kill the operation of the diode )

https://www.semtech.com/uploads/common/PB-SEMTECH-TVS-I2C-BUS.pdf

https://assets.nexperia.com/documen...ochure_ESD-Protection-Applications_022017.pdf


But

I2C, being low resistance ( due to the pull ups )
is incredibly robust

I'd suggest the problem lies with the way the sections are powered up ,

You say you have power chips,
are some of the sections by some chance powered down when others are powered up. whoch are joined by the I2C bus.


How about a block diagram, showing the power control / I2C bus
We don't need function names, so nothing sensitive,
 

Thread Starter

josmA

Joined Jun 12, 2019
35
First just a general question: are your probes calibrated? This might influence the display of signal rise times...

From the given images i don't see any reason for your I2C drivers to fail.
Some suggestions:
- Maybe look at the signals over a longer period of time, and don't look at the protocol but at the peak to peak values
- Does the custom/slave board include power switching electronics, if so can you see any changes in the peak to peak values if they are active or inactive?
- If the defective development board, can you determine the defect. When using the same pins as digital IO what fails, when used as input, if used as output can it pull the line up and down?
Hi, sorry for the late reply,
The slave board includes several switching regulators. I haven't appreciated any change in the peak values in the past, I will have a look today, but I noticed that the noise of the 3.3v rail increased.
The faulty pin is the one configured as SDA, and I changed to GPIO output, but it is not able to put the line up, stay always down.

Thanks
 
Top