Question Why do I2C pins have to be open-drain and not push-pull? Answer Setting the I2C pins to push-pull can cause damage to the devices on the bus. The reason this is an issue is that
Question
Why do I2C pins have to be open-drain and not push-pull?
Answer
Setting the I2C pins to push-pull can cause damage to the devices on the bus. The reason this is an issue is that there are three parts of the I2C communication protocol specifically that can result in a direct short from power to ground:
- Bus arbitration if there is more than one master on the bus
- Slave clock stretching
- ack/nack
In these above three scenarios, it is possible for one device to be driving SDA high, while another device on the bus is driving SDA low. If the outputs are open-drain, devices can only drive low, or float (pulled-up in the case of I2C). In the above three scenarios, this means there is no conflict since the device driving low will always win on the bus.
If the outputs are push-pull, then the only two possible states are drive low or drive high; there is no "float" state. In the above three scenarios with push-pull outputs, one device on the bus will be driving SDA low, and another will be driving SDA high, so there will be a direct short between power and ground through the two devices. This can cause damage to the devices and is not recommended.
Link: https://community.silabs.com/s/article/why-do-i2c-pins-have-to-be-open-drain-and-not-push-pull-x?language=en_US
Không có nhận xét nào:
Đăng nhận xét