News:

Let's find out together what makes a PIC Tick!

Main Menu

I2C Oled

Started by Pepe, Oct 14, 2023, 11:36 AM

Previous topic - Next topic

Pepe

I would like to know why a pulldown resistor should be put in the sda so that the program does not get stuck in I2C communication with an Oled display if it is disconnected from the circuit because it is only used for debugging.

tumbleweed

An I2C interface should not have a pulldown resistor. The open-drain SDA/SCL lines require pullups (which would typically be placed on the master side). An idle bus is SCL=SDA=1, so a pulldown would conflict with that.

Where do you see a pulldown recommended?

I would imagine that someone is trying to generate a default "ACK", but there are better ways to detect if the OLED is connected or not... when you communicate with the OLED send the device address and if you get a NACK then the OLED is not present. Set a flag and skip all further communications.