Author Topic: I2C - is it bad to have a slow SCL rise time?  (Read 2932 times)

0 Members and 1 Guest are viewing this topic.

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
I2C - is it bad to have a slow SCL rise time?
« on: October 06, 2021, 08:03:51 am »
Hi :)

I've got this I2C bus between my uC and two devices, running at 50kHz.

I measured the ICL rise time (from 0.3Vcc to 0.7Vcc) of about 600ns. But that is including the capacitance of the probes, so I'm thinking the real rise time is a little lower.

One of the device (an EEPROM) says max 300ns rise and fall time.

Everything seems to work perfectly fine - but is this something I should look into or is the "max rise time" spec of the devices only important when running at high speed?

Thank you

Simon
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5133
  • Country: bt
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #1 on: October 06, 2021, 08:44:59 am »
What are your I2C pull-up resistors??
Readers discretion is advised..
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7909
  • Country: nl
  • Current job: ATEX product design
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #2 on: October 06, 2021, 08:56:30 am »
600ns isn't slow it is OK, for a bus which is supposed to work at 400 KBAUD.
If you can, decrease the value of the pullup resistor. Check if the EEPROM can do 3 MHz I2C, which is called fast mode plus, or superspeed or hyperspeed or whatever. Maybe the rise time is because of that.
 
The following users thanked this post: Saimoun

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4278
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #3 on: October 06, 2021, 08:59:22 am »
The only reason it would be bad, is if:

- it's noisy,
- it spends significant time around the transition region from 0 to 1, and
- the receiving device does not have inputs with hysteresis, so it sees multiple transitions as the noise takes the signal between logic 0 and 1 levels multiple times

I2C devices usually have Schmitt trigger inputs which include hysteresis, so it's not a problem. However, if a device's data sheet specifies a max rise time, it's a good idea to meet this spec.

The rise time, and issues that a slow rise time might cause, has nothing whatsoever to do with the bus speed (ie. number of edges / sec).
 
The following users thanked this post: Saimoun

Offline PeteH

  • Supporter
  • ****
  • Posts: 117
  • Country: ca
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #4 on: October 06, 2021, 10:29:18 am »
Typically the MAX rise time is spec'd for reliable operation near the high end of the speed range of the device.... I.e. fast mode, 1kHz to 400kHz... Max of 300ns makes sense.

If you run nowhere near 400kHz, you can derate the rise time in proportion.
Other thing is ultra low power design, you may not want to have very slow transitions (even with Schmitt's) but 600ns sounds perfectly fine....
 
The following users thanked this post: Saimoun

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #5 on: October 06, 2021, 02:06:48 pm »
Thank you all for the replies!!  8)

Your answers make me think I might have misunderstood the datasheet - looking at this one for example: https://www.st.com/resource/en/datasheet/m24c02-f.pdf

Page 21 (attached) it says max 50ns SCL input rise/fall time. Is that a requirement or is that the specs of how fast the IC can move SCL and SDA? If it is the latter, then it does not make sense since this is only a slave and will therefore never move the SCL line...? :o

 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #6 on: October 06, 2021, 02:11:22 pm »
As for the device I am actually using, it is basically an equivalent from Shanghai Belling, and the datasheet is not the best: https://datasheet.lcsc.com/lcsc/2003172239_BL-Shanghai-Belling-BL24C02F-RRRC_C498263.pdf

It does say "Input Rise Time" and "Input Fall Time" at max 0.3us (see attached screenshot).
 

Offline harerod

  • Frequent Contributor
  • **
  • Posts: 469
  • Country: de
  • ee - digital & analog
    • My services:
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #7 on: October 06, 2021, 06:08:14 pm »
A great opportunity to have a look at the actual I2C specification:
https://www.nxp.com/docs/en/user-guide/UM10204.pdf

Your device seems to implement and specify the "fast mode" alone. Incidentally, that datasheet is not too different from the Microchip AT24C256's.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3322
  • Country: gb
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #8 on: October 06, 2021, 06:33:56 pm »
Thank you all for the replies!!  8)

Your answers make me think I might have misunderstood the datasheet -

Those are the measurement conditions i.e. the state under which the values in the performance characteristics are valid.

The actual performance characteristics are in tables 15 (400kHz) and 16 (100kHz) in the M24C02 datasheet.  The parameter of interest for you is tXH1XH2 which has a maximum value of 1us for 100kHz operation.

 
The following users thanked this post: ebastler

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5133
  • Country: bt
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #9 on: October 06, 2021, 08:06:17 pm »
What are your I2C pull-up resistors??
Tell us the value of your I2C pullup resistors..
Readers discretion is advised..
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3999
  • Country: ua
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #10 on: October 06, 2021, 08:21:45 pm »
rise time requirements are intended to guarantee specific communication speed. Slow rise time leads to a lower communication speed limit. But on the other hand, the fast rise time makes your circuit more sensitive to a high frequency noise and interferences from other equipment. So, the slow rise time is a good for protection from noise and interferences, but it is bad for a high speed communication. And vice versa.

The actual rise time will depends on transmission line properties. If you have no errors at max required communication speed, then rise time is fast enough for your needs.

You can try to slow down rise time for a little with capacitor and check if communication is still ok. If it still has no error then your rise time is good enough and has some reserve margin.
« Last Edit: October 06, 2021, 08:34:30 pm by radiolistener »
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #11 on: October 07, 2021, 07:07:57 am »
Thank you all again for the replies - I think I have a much better understanding of it now.

@mikerj: thank you! Gosh I don't know how I missed that ha ha :P Makes much better sense now.

@imo: the pullup are weak internal pullups in one of the I2C slave ICs (value is not mentioned).
There are no capacitors on the bus lines, so I would estimate bus capacitance C=15pF. So by measuring tau=RC=750ns (63% of the rise time) , I get R=50k, which also fits what you would expect from a "weak pullup".

Now before everybody starts bashing me, let me explain my trail of thoughts: I really do not need fast speed, and I would rather be on the safe side of EMC.
I heard 4.7k external pullup is standard'ish, but also that one should add a 100pF capacitor to "slow it down". That would give tau=RC=470ns.

So I thought why not saving PCB traces, space, and two resistors and two capacitors by simply using the weak internal pullups? This would give the same result anyways, and lower currents :)

Now you may bash - I'm ready  :box: 
 ;D ;D
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5133
  • Country: bt
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #12 on: October 07, 2021, 08:04:15 am »
..
@imo: the pullup are weak internal pullups in one of the I2C slave ICs (value is not mentioned).
There are no capacitors on the bus lines, so I would estimate bus capacitance C=15pF. So by measuring tau=RC=750ns (63% of the rise time) , I get R=50k, which also fits what you would expect from a "weak pullup".
And that is the answer to your original question: why the edges are so slowish..

I2C bus resistors are typically set from 1k to 10k based on the required speed. The faster you want go (and/or the more devices hanging on the bus) the lower values should be the pullups. The I2C bus works with "open collectors/drains" where the bus has to be terminated with the pullups otherwise it will not work - the "chip's output" only pulls down the line to log0, the logic one is created by pulling up the line via the resistor to Vcc (and the bus capacitances and the pullups create the RC you see). It means you have not wired those pullups yet and your stuff works by chance..  :D

« Last Edit: October 07, 2021, 08:21:10 am by imo »
Readers discretion is advised..
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6228
  • Country: es
Re: I2C - is it bad to have a slow SCL rise time?
« Reply #13 on: October 07, 2021, 09:31:54 pm »
600ns slow?  For a simple pullup resistor driven bus?
That's almost 2MHz, quite fast indeed.
Also I don't think you need to measure the complete rise time, but to the min. Specified high level threshold, over that, it does nothing.

For 20pf and 10K you get 2RC of 400ns, so it's pretty close.
I say 2RC because it's pretty enough, already 90% of VDD.
Lower the pullup to 4k7 or 2k2, will lower the rise times a lot.
However, the falling times should be much faster, as it's actively pulled down.
« Last Edit: October 07, 2021, 09:49:05 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: Saimoun


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf