When we first come into contact with the 51 single-chip microcomputer, a pull-up resistor must be added to the P0 port, otherwise P0 will be in a high-impedance state.
You may be confused about this question, why is it a high impedance state? Add a pull resistor? Today I will briefly explain this concept.
High impedance state is a common term in digital circuits, referring to an output state of the circuit that is neither high nor low.
If the high-impedance state is input into the next-level circuit, it will have no effect on the next-level circuit, just like it is not connected. If measured with a multimeter, it may be a high level or a low level, depending on what is connected behind it.
The essence of high impedance state
When analyzing a circuit, the high impedance state can be understood as an open circuit. You can think of it as a very large output (input) resistance.
Its limit can be considered as floating, that is to say, in theory, the high impedance state is not floating, it is a state with extremely large resistance to the ground or power supply. In practical application, it is almost the same as the floating of the pin.
The meaning of high impedance
When the output pull-up tube of the gate circuit is turned on and the pull-down tube is turned off, the output is a high level, otherwise it is a low level.
If both the pull-up tube and the pull-down tube are cut off, the output end is equivalent to floating (no current flows), and its voltage level depends on the external voltage level, that is, the gate circuit gives up control of the output circuit.
-
In the bus connection structure, there are multiple devices on the bus, and the devices are connected to the bus in the form of high impedance. In this way, the bus is automatically released when the device does not occupy the bus, so that other devices can obtain the right to use the bus.
-
Most MCU I/O can be set to high-impedance input when in use. High-impedance input can be considered as an infinite input resistance, and the I/O has little effect on the previous stage, and does not generate current (no attenuation), and to a certain extent also increases the chip's ability to resist voltage shocks.
-
-
Common representation of high impedance state: The high impedance state is usually represented by the letter Z.
In a system or in a whole, we often define some reference points, just like the sea level we often talk about. The same is true in a single chip. Whether we say high level or low level, it is relative. It may be easier to understand this issue if this point is made clear.
High impedance state in microcontrollers
In the 51 single-chip microcomputer, the P0 port without a pull-up resistor is connected to the I/O port pin and the power supply through a pair of push-pull FETs compared to the P1 port with a pull-up resistor. The specific structure of 51 is shown in the figure below.
The push-pull structure can theoretically easily output large current and improve load capacity by adjusting the parameters of the tube. The two tubes have four different combinations according to the on-off state. The conduction of the upper and lower tubes is equivalent to short-circuiting the power supply. This situation must not occur in the actual circuit.
From the perspective of the logic circuit, when the upper tube is on and the lower tube is off, IO is directly connected to VCC, and IO outputs a low level of 0. In this structure, if there is no external pull-up resistor, output 0 is an open drain state (low resistance state), because the I/O pin is grounded through a tube, not directly connected using a wire, and a general MOS will also have an on-resistance of mΩ when it is on.
It is very clear here. Both low-impedance and high-impedance states are relative. Putting the lower tube in the cut-off state can isolate the GND and I/O port to reach an open circuit state. At this time, the push-pull pair of tubes is in the cut-off state. If the reading logic is ignored, the I/O port pin is equivalent to an open circuit with the internal circuit of the microcontroller. Considering that there will be a small leakage current when the actual MOS is cut off, it is called a "high-impedance state".
Due to the influence of the junction capacitance brought by the PN junction of the tube, some materials may also call it "floating". It takes a certain amount of time to charge the capacitor through the I/O port. Then the actual voltage at the IO pin to the ground is similar to a buoy floating on the water surface. The voltage is not only related to the external input but also to time. This phenomenon cannot be ignored under high frequency conditions.
In a word, high impedance is a relative concept. When using it, we just need to do it according to the requirements. If we are asked to add pull-ups, we will add them. There is a certain reason.
Source: Internet
Focus on industry hot spots and understand the latest frontiers
Please pay attention to EEWorld electronic headlines
https://www.eeworld.com.cn/mp/wap
Copy this link to your browser or long press the QR code below to browse
The following WeChat public accounts belong to
EEWorld (www.eeworld.com.cn)
Welcome to long press the QR code to follow us!
EEWorld Subscription Account: Electronic Engineering World
EEWorld Service Account: Electronic Engineering World Welfare Club