Comparison of single-chip microcomputer driving common anode digital tube and common cathode digital tube[Copy link]
When a single-chip microcomputer drives a digital tube, there are two ways to connect it: common anode and common cathode. In this article, a comparison is made between the single-chip microcomputer driving common anode digital tubes and common cathode digital tubes, hoping to be helpful to electronic enthusiasts. The positive end of the common anode digital tube is connected to the positive power supply, and the negative end is connected to the P port through a current limiting resistor. At this time, there is no need to connect a pull-up resistor, as long as the current limiting resistor is appropriate. When the common anode digital tube is on, the current is from the positive power supply → common anode digital tube → current limiting resistor → P port, and the P port is at a low potential; when the common anode digital tube is off, no current flows through, and the P port is at a high potential or high resistance state. The negative end of the common cathode digital tube is grounded, and the positive end is directly connected to the P port. At this time, a pull-up resistor should be connected. This pull-up resistor is used to provide the digital tube with light. When the common cathode digital tube is bright, the current is from the positive power supply → pull-up resistor → digital tube → ground. 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 common cathode digital tube is dark, the current is from the positive power supply → pull-up resistor → P port. At this time, no current flows through the digital tube, the P port is at a low potential, and the current flowing through the current limiting resistor all flows into the P port. This article does not analyze other situations in detail. Common cathode digital tube yunrun.com.cn/tech/2065.html The comparison of the single-chip microcomputer driving common anode and common cathode digital tubes should start with the output driving capability of the single-chip microcomputer. The single-chip microcomputer output drive is divided into two modes: high-level drive and low-level drive. The so-called high-level drive is the driving capability when the port outputs a high level; the so-called low-level drive is the driving capability when the port outputs a low level. When the single-chip microcomputer outputs a high level, its driving capability is actually driven by the pull-up resistor of the *port. Actual tests show that the pull-up resistor of the 51 single-chip microcomputer has a resistance of about 330K, that is to say, if the *high-level drive is used, the *330K pull-up resistor is essentially used to provide current. Of course, the current is very small , even the small light-emitting diodes are difficult to light up. If you want to ensure that the digital tube lights up normally, you must connect a pull-up resistor of about 1K. If it is one digital tube, it is okay. If there are n digital tubes, you must connect n 1K pull-up resistors. Connecting the resistors themselves is okay, but the problem is that after connecting the pull-up resistors, whenever the port becomes a low level 0, then n pull-up resistors are turned on uselessly. Assuming that the current of each resistor is 5mA, n resistors are 5mA×n current, which will cause a serious decrease in power supply efficiency, causing the power supply to heat up, the ripple to increase, and even cause the microcontroller to work unstable. Therefore, it is rare to use a high level to directly drive the digital tube, that is, it is rare to use a microcontroller to drive a common cathode digital tube. Low-level driving is different. When the port is at low level 0, the switch tube inside the port is turned on, which can drive a driving current of up to more than 30 mA, and can directly drive loads such as digital tubes. When the port is at low level 0, although the internal pull-up resistor also consumes current, the internal pull-up resistor is very large, 330K, so the current consumption is extremely small, which basically does not affect the power efficiency and does not cause a lot of useless consumption. For example: When the author used 75HC573 to drive the digital tube for the first time, the microcontroller IO output was 5V. During the test, it was found that the brightness of the digital tube was very low no matter how it was adjusted. After careful analysis, it was found that I did not fully understand the common cathode and common anode connection of the digital tube: the common end of the common anode digital tube is the anode, connected to one IO port, and the current is very small; the common end of the common cathode digital tube is the cathode, connected to multiple IO ports, and the current is very large. Understand the difference in the principles of common cathode and common anode digital tubes, and make a slight adjustment to solve the problem. Therefore, the 51 single-chip microcomputer cannot directly drive the digital tube with a high level, but can only directly drive the digital tube with a low level, that is, the 51 single-chip microcomputer can only use a common anode digital tube, but cannot directly use a common cathode digital tube.