Author Topic: Advice needed - I2C Bus & I2c PCB trace  (Read 4083 times)

0 Members and 1 Guest are viewing this topic.

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
Advice needed - I2C Bus & I2c PCB trace
« on: July 17, 2018, 04:11:32 pm »
Hello Everyone,

I'm just about to start combining (basically) a number of schematics (with tweaks) from datasheets on to a double sided PCB. Other than hobbyist 1 or 2 chip boards, this one is going to be the most complicated one I've done.

The project is a glorified switch matrix and LED driver with an RTC and Elapsed Timer with a SPI CAN interface linked to a third uC.
Ultimately, it will have 2 uC on board (probably Nanos) and if memory serves me right 4/5 devices connected on the 12C bus. Probably the uC's will be at the ends to allow for future motor control.

1.) Now, I know there is a maximum capacitance on the 12C bus of 400pF and 10K Pull-ups are required (initial value). Are these pullups needed for every device, at one end, both ends, roughly in the middle or it doesn't matter as long as they are connected?

2.) Are there any specific requirements to routing of the SDA and SCL lines.

3) Any general advice for PCB layout (Kicad or Easyeda and JLCPCB manufactured)

Thanks
Matt
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: Advice needed - I2C Bus & I2c PCB trace
« Reply #1 on: July 17, 2018, 04:32:02 pm »
in practice it doesn't matter much, where the pullups are placed. of course, the higher the clockrate goes, the more you have to watch for both - the place for the pullup and the routing on the pcb. For the classical speeds of 100kHz and in most cases also for 400kHz it's not much critical. Basically avoid digital lines from coupling in analog ones and vice versa.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Advice needed - I2C Bus & I2c PCB trace
« Reply #2 on: July 17, 2018, 05:37:05 pm »
There is a standards document for I2C published by NXP

What you will find is that the pull-up resistors usually need to be a good deal smaller than 10k.  I often wind up around 2.2k and that's a good number because the line drivers are limited to 3 mA and 5V / 3 mA is 1666 Ohms.

https://www.nxp.com/docs/en/user-guide/UM10204.pdf
https://www.nxp.com/docs/en/application-note/AN10216.pdf

OTOH, it might work perfectly with 10k resistors.  I just tend to go toward the minimum value to overcome any capacitance I can't account for.
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: Advice needed - I2C Bus & I2c PCB trace
« Reply #3 on: July 17, 2018, 06:32:00 pm »
that's true; and the higher you go with the clockrate, the lower you choose the pullup; I normally use 4k7 or 2k2
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1560
  • Country: gb
Re: Advice needed - I2C Bus & I2c PCB trace
« Reply #4 on: July 18, 2018, 06:32:08 pm »

1.) Now, I know there is a maximum capacitance on the 12C bus of 400pF and 10K Pull-ups are required (initial value). Are these pullups needed for every device, at one end, both ends, roughly in the middle or it doesn't matter as long as they are connected?

You only need one pullup resistor per signal (unless you are going something multi-board and don't want to have some of the boards in an undefined state). Check the standard for the rise times and adjust the pullups until you meet the requirements with a comfortable margin

Quote
2.) Are there any specific requirements to routing of the SDA and SCL lines.

No, although running the two lines side by side means that they will have a similar capacitance.

Quote
3) Any general advice for PCB layout (Kicad or Easyeda and JLCPCB manufactured)
Sorry - I don't have any experiance in those.
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf