Electronics > Beginners

Advice needed - I2C Bus & I2c PCB trace

(1/1)

Docara:
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

HB9EVI:
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.

rstofer:
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.

HB9EVI:
that's true; and the higher you go with the clockrate, the lower you choose the pullup; I normally use 4k7 or 2k2

Neilm:

--- Quote from: Docara on July 17, 2018, 04:11:32 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?

--- End quote ---

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.

--- End quote ---

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)

--- End quote ---
Sorry - I don't have any experiance in those.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod