The reason why the driver of the single-chip microcomputer should be set to low level is

  

Like other beginners, I found that many peripheral circuits and programming of many single-chip microcomputers are mostly driven by an active low level, while the high level is high. It is very rare. Do not understand, search, understand, summarize, share.

Question:

The peripheral circuit design and programming of the MCU are mostly driven by an active low level.

Answer:

This is because the sink current at the low level of the microcontroller is generally larger than the current sink at the high level. For example, the I/O port of the general 51 series MCU can output 4mA of current or 20mA of sink current; while other chips, such as PIC MCU, have some very useful general-purpose features: I/O port sink current /current sink Very large ——25MA/25MA.

Summary:

Summary: Drive with low level, high current sinking and strong driving capability.

In-depth understanding:

Problem:

The pins of some chips are active low, why should we add a pull-up resistor on the active-low pin? Isn't this high level?

Answer:

Add a pull-up resistor to the active-low pin to make this pin in an abnormal state. The input is in an inactive state and can be immune to interference.

Answer: This is because it is required to be versatile. It is also suitable for voltage problems of various electronic components.


Related information:

Talk about the interface drive capability of single-chip microcomputer

We know that the interface of the single-chip microcomputer has a certain driving ability, but when can it be used when it needs to add another device?

When driving the LED light-emitting tube, it should be divided into a common anode connection method and a common cathode connection method. When the anode is positive, the positive terminal of the LED is connected to the positive power supply, and the negative terminal is connected to the P port through a current limiting resistor. At this time, there is no need to connect the pull-up resistor. As long as the current-limiting resistor is suitable, the current is from the power supply. The current is from the power supply. ——LED—— current limiting resistor ——P port, P port is low Potential. When the LED is off, no current flows, and the P port is high or high impedance. Common cathode connection method, LED negative terminal grounding, positive terminal direct P port, this time to connect the pull-up resistor, this pull-up resistor is used to provide LED lighting, when the luminous tube is bright, the current is from the power supply —— Pull resistor —— LED—— At this time, the pull-up resistor is also used for current limiting, and the P port is in a high potential or high resistance state. When the light-emitting tube is dark, the current is from the power supply —— pull-up resistor ——P port, when the LED has no current flowing, the P port is low, and the current flowing through the current limiting resistor all flows in from the P port. Start with the output drive capability of the microcontroller.

The following is the LED pull-up resistance test I have done

Test conditions: VCC=4.96V, & phi; 3 green LED. The anode of the diode is connected to VCC, and the cathode is grounded by RL. There is no greater resistance test because my multimeter's voltage barrier has an internal resistance of 10M.

RL VLED VRL Current Brightness---------------------------- 1K 1.93V 3.03V 3mA Very Bright 5K 1.82V 3.14V 0.6mA Brighter 100K 1.66V 3.30V 33uA Lighter 3.3M 1.51V 3.45V 1.0uA No light 10M 1.42V 3.45V 0.3uA No light ----------------- ----------- It can be seen from the above test that the LED voltage drop is obvious even when the LED has a small current. This also corresponds to the characteristic curve of the light-emitting diode. Therefore, if the internal resistance of the next stage driven by the LED is relatively small (less than 10M), then the output must be about 3V. Of course, if the pre-driver circuit used has internal pull-up (such as PCu8574T with 100uA weak pull-up, 51 P1 or P2, P3 port, etc.), it is another matter. So I said that if this is the best way to parallel a 10K resistor.

The single-chip output driver is divided into two modes: high-level drive and low-level drive. The so-called high-level drive is when the port outputs a high level. The drive capability, the so-called low-level drive, is the drive capability when the port outputs a low level. When the MCU outputs a high level, its drive capability is actually driven by the pull-up resistor of the * port. The actual test shows that the 51 MCU The pull-up resistor has a resistance of about 330K, which means that if the * high-level drive is essentially a pull-up resistor of *330K to supply current, the current is very small, and even small LEDs are difficult. Light up, if you want to ensure that the LED light-emitting diodes are normally illuminated, you must connect an external pull-up resistor of about 1K. If it is a led, if 10 or 20 LEDs, you must connect 10, 20 1K. The pull-up resistor, the resistor itself is ok, the problem is that after the pull-up resistor is connected, whenever the port becomes low level 0, then 10, 20 pull-up resistors are uselessly turned on. Assume that each The current of the resistor is 5mA, and the 20 resistors are 100mA. This will cause a serious drop in power efficiency, resulting in heat generation and ripple increase, which will cause the microcontroller to work unstable. Therefore, it is rare to use a high level to directly drive the LED. The high-level drive led is actually a common shade. The low-level drive is different. When the port is low level 0, the switch inside the port is turned on, which can drive up to 30 mA of drive current, and can directly drive the load such as led. When the port is low level 0 Although the internal pull-up resistor also consumes current, since the internal pull-up resistor is large, there is 330K, so the current consumption is extremely small, basically does not affect the power supply efficiency, and does not cause a large consumption of useless power, so 51 single-chip microcomputer It is not possible to directly drive the LED light-emitting tube with a high level. It can only directly drive the LED with the ground level, that is, it can only use the common digital tube, but can not directly use the common digital tube.



Copyright © Windows knowledge All Rights Reserved