When we design the peripheral circuit of the IIC interface, we usually use the topology diagram with pull-up resistor shown in Figure 1, and its internal structure is the open-drain output shown in Figure 2.
The open-drain output level is controlled by an external pull-up and internal logic, allowing the bus to be pulled low and released. The bus open-drain circuit consists of an NMOS transistor, which is turned on and off by a control signal. When the control signal turns on the NMOS transistor, the output is low. When the control signal turns off the NMOS transistor, the output is floating, requiring an external pull-up resistor to output a high level.
This structure allows the open-drain gate to flexibly control the bus level while avoiding direct driving of the bus, thus ensuring secure connection and communication between multiple devices. The advantages of using this open-drain output are obvious and are reflected in the following aspects:
1. Short-circuit Prevention
If the push-pull configuration is used instead of open-drain, and several devices are connected to the same bus, and an IO on one device outputs a high level while an IO on another device outputs a low level, the VCC and GND connections of these two IOs will short-circuit, causing circuit damage. However, the open-drain configuration eliminates this problem. Regardless of the number of devices connected to the bus, there is no power short-circuit risk.
2. Increase drive capability and reduce power consumption
Connecting a pull-up resistor to the drain_output pin allows for level shifting and provides stronger drive capability. This leverages the drive capability of the external circuit to reduce the internal IC drive. When the internal MOSFET of the IC is on, the drive current flows from the external VCC through Rpull-up, the MOSFET, and then to GND. Only a small gate drive current is required within the IC.
3. Use "Wired AND" to determine bus active status
Multiple open-drain output pins can be connected to a single line to form an "AND" logic relationship, known as the "wired AND" function. When any one pin goes low, the logic level on the open-drain line becomes 0. This is also the principle used by the I2C bus to determine bus active status.
4. Facilitate output level shifting
The transmission level can be changed by varying the pull-up power supply voltage, while the output high level is determined by VDD.
Xml سياسة الخصوصية المدونة خريطة الموقع
حقوق النشر
@ شركة مايكرو ماجيك كل الحقوق محفوظة.
دعم الشبكة