Can I use GPIO 12 and 13 for I2C bus?

I am a bit confused by the documentation for the ESP32S3 N8R16 devkit boards. These boards have 2 USB-C connectors and the reset/boot buttons up near the processor. Please see attached picture. I have both boards on hand. I am attaching them to a 4 layer PCB, so it would be very hard to re-route the signals if I am using the wrong GPIOs.

My questions are:

  1. Can I use GPIO 12 and 13 for an I2C bus? Some references say GPIO 12 is a boot strapping pin, others say OK.
  2. What are the internal pullups for these two pins? I want to make sure I have the right level of pullups on these two I2C lines. Some references say GPIO 13 is only for SDI bus, and has no internal pullup, others say OK.

They are ok for i2c.
Internal pullup is really weak, ~50k.

I need a sanity check on my design for I2C SDA and SCL pullups.

A simplified schematic is below. I have the same arrangement for SDA using GPIO 12. The display needs to run at 5V as 3.3V is too dim, hence the Q5 level shift from 3.3V to 5V.


Since GPIO 12 and 13 have internal pullups around 45K-50K, I believe I need both R34 and R36 as 10K pullups to make the combined pullup for I2C ~4.5K. I don't think R35 enters into the calculation, but I could be wrong.

The board is a 4 layer PCB with all SMD parts, so making changes after fabrication will be tough.

If you're using the Adafruit INA260 breakout board, it has 10K pullups already on it. So your combined pullups on the 3.3V side would be ~ 3.1K.

1 / ( 1/10000 + 1/10000 + 1/10000 + 1/50000)

As a rule of thumb I usually go with 3.3K for 3.3V @ 100KHz, so that's in the neighbourhood.

Why you open new topic for same subject of previous?

Omitting resistors does not require any PCB changes. Don't solder an R36 if R34 is sufficient.

Each SCL and SDA line requires a pullup resistor to the related logic HIGH level. The value(s) depend on the presence of already present pullups and your intended pullup current. Low current reduces the reliability and speed of the bus, high current must not exceed the current capability of the weakest node.

I am not using the Adafruit board, but I did steal their schematic. lol. The INA260 block is actually the INA260 chip.

I only have 2x10K resistors on the SCL and SDA traces. Do I need another 10K resistor on each of the SCL and SDA lines?

My ability to solder or remove 0603 or even 0805 SMD parts is problematic.

I am trying to avoid that process. I can add in solder pads, but I was just thinking that I will need both R34 and R36 to get down around 4.5K for the combined pullup, which I believe is the high end of what is recommended.

My last post was about GPIO pins and I2C. This post is about pullup resistors. They seem to me to be different topics.

I agree, merged.

@pmi1234 ,

I have merged your 2 topics because the question about what pull-up resistors you need naturally follows from your first question.

Thanks,

1 Like

My apologies for starting a new topic. I had a 50/50 chance that someone would complain my second post was a new topic and a 50/50 chance someone would say it wasn't. :rofl:

1 Like

It depends on the already existing pullup(s) on the line. AFAIR the suggested current is 1 to 3 mA. You can measure that actual current by a meter from the signal line to GND.

You didn't bother to even replay to first one before opening next one...

All of the pullups on the SCL and SDA lines are shown in the schematic. it is hard to measure the current on the line before the board is built. I am trying to analyze the problem and come up with a good solution before the board is built.

Thank-you for your reply to my earlier post. You answered my question. I apologize if I offended you in any way.

Add pads for a pullup resistor to your board. This allows to solder or omit a pullup resistor to the ready made board, depending on the actually added I2C devices/boards. Are you sure that your board or proeject will never need updates?

I suggest you include space on the board for pull up resistors, you can decide if they are needed and what values when you add the components to the board.

Value needed depends on the wiring (capacitance) on those lines.
10k is fine for I2C links on a circuit board, and even OK for Dupond wires to a breadboard.
Longer wiring might need more pull up current.
Leo..