Problems with pull-up resistors in microcontroller-driven LEDs

Publisher:SparkleMagicLatest update time:2013-01-07 Source: 51hei Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
When driving LED light-emitting tubes, there should be two types of connection: common anode connection and common cathode connection. When common anode is used, the positive end of the LED 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 light-emitting tube is on, the current is from the positive power supply - LED - current limiting resistor - P port, and the P port is low potential. When the light-emitting tube is off, there is no current flowing through. The P port is high potential or high resistance state. Common cathode connection, the negative end of the LED 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 LED light. When the light-emitting tube is on, the current is from the positive power supply - pull-up resistor - LED - ground. At this time, the pull-up resistor is also used for current limiting. When the P port is high potential or high resistance state, when the light-emitting tube is dark, the current is from the positive power supply - pull-up resistor - P port. At this time, no current flows through the LED, the P port is low potential, and the current flowing through the current limiting resistor flows from the P port. Let's start with the output drive capability of the microcontroller.

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

Test conditions:
VCC=4.96V, φ3 green LED.
The anode of the diode is connected to VCC, and the cathode is grounded through RL.
No larger resistance test was performed because the internal resistance of my multimeter voltage range is 10M.

RL VLED VRL Current Brightness
----------------------------
1K 1.93V 3.03V 3mA Very bright5K
1.82V 3.14V 0.6mA Relatively bright100K
1.66V 3.30V 33uA Slightly bright3.3M
1.51V 3.45V 1.0uA Not bright10M
1.42V 3.45V 0.3uA Not bright
----------------------------
From the above tests, it can be seen that even when the light-emitting diode has a very small current, the voltage drop of the LED is very obvious. This is also in line with the characteristic curve of the light-emitting diode.

Therefore, if the internal resistance of the next stage driven by the light-emitting diode is relatively small (less than 10M), then its output must be around 3V.

Of course, if the pre-stage driver circuit used has an internal pull-up (such as the 100uA pull-up in PCF8574T, P1 or P2, P3 port of 51, etc.), it is another matter. So I said that if it is used in this way, it is best to connect a 10K resistor in parallel.

The output drive of the single-chip microcomputer is divided into two modes: high-level drive and low-level drive. The so-called high-level drive is the driving ability when the port outputs a high level, and the so-called low-level drive is the driving ability when the port outputs a low level. When the single-chip microcomputer outputs a high level, its driving ability is actually driven by the pull-up resistor of the *port. The actual test shows that the pull-up resistor of the 51 single-chip microcomputer is about 330K, that is to say, if the *high-level drive is used, it is essentially the *330K pull-up resistor that provides current. Of course, the current is very small, so small that it is difficult for the light-emitting diode to light up. If you want to ensure that the LED light-emitting diode emits light normally, you must An external pull-up resistor of about 1K is fine if it is just one LED, but if there are 10 or 20 LEDs, you will need to connect 10 or 20 1K pull-up resistors. Connecting the resistors themselves is fine, but the problem is that after connecting the pull-up resistors, whenever the port becomes a low level 0, 10 or 20 pull-up resistors will be turned on uselessly. Assuming that the current of each resistor is 5mA, 20 resistors are 100mA, which will cause a serious drop in power supply efficiency, resulting in heat and increased ripple, which will cause the microcontroller to work unstable. Therefore, few people use high-level direct drive LEDs. High-level drive LEDs are actually common cathode. Low-level drive is different. When the port is at a low level of 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 LEDs. When the port is at a low level of 0, although the internal pull-up resistor also consumes current, since the internal pull-up resistor is very large, 330K, the current consumption is extremely small, which basically does not affect the power efficiency and does not cause a large amount of useless consumption. Therefore, the 51 single-chip microcomputer cannot use a high level to directly drive the LED light-emitting tube, but can only use the ground level to directly drive the LED, that is, it can only use a common anode digital tube, but cannot directly use a common cathode digital tube.

Keywords:MCU Reference address:Problems with pull-up resistors in microcontroller-driven LEDs

Previous article:Design of fuzzy control system for growing selenium melon in greenhouse
Next article:I2C bus driver (C51 language source program)

Recommended ReadingLatest update time:2024-11-16 14:31

8x8LED dot matrix + single chip microcomputer + Puzhong + Jiangkeda Automation Association
1 Function: (1) Static display: display a smiling face; (2) Dynamic display: a, moving display of “HELLO!”, b, display of the change of smiling face and crying face; 2 Principle 3 Block Diagram 4 Hardware Schematic Diagram 5 Software Design 5.1 Static display source p
[Microcontroller]
8x8LED dot matrix + single chip microcomputer + Puzhong + Jiangkeda Automation Association
Design and drive control of LED dot matrix display unit
LED dot matrix display screens are widely used in shopping malls, railway stations, commercial advertisements and signal signs due to their convenient control, long service life, easy construction and low construction cost. LED dot matrix screens of a certain size are composed of multiple display units. This article in
[Power Management]
Design and drive control of LED dot matrix display unit
Analysis of the reset function inside the AVR microcontroller
Reset of AVR microcontroller: watchdog reset, power-on reset, power-off reset. I see that everyone is not very clear about the reset function, especially the reset function inside the AVR microcontroller. Now I will briefly talk about it here, and I hope you can have a general understanding at home. There are four t
[Microcontroller]
Analysis of the reset function inside the AVR microcontroller
How to burn a bootloader on a microcontroller
Introduction If you are looking at this project then you have probably used an Arduino board before. The ATmega328 microcontroller on the Arduino UNO is likely to fail after a certain amount of time (or incorrect connections). In order to reuse the Arduino Board you will need a new ATmega328 IC with a bootloader insta
[Microcontroller]
How to burn a bootloader on a microcontroller
MCU controlled 28BYJ-48 stepper motor driver source code
The single chip microcomputer source program for controlling the 28BYJ-48 stepper motor driver is as follows: #include reg52.h #include intrins.h unsigned char CCW ={0x80,0xC0,0x40,0x60,0x20,0x30,0x10,0x90}; //Counter-clockwise rotation phase sequence table unsigned char CW ={0x90,0x10,0x30,0x20,0x60,0x40,0xC0,0
[Microcontroller]
Reading and writing of EEPROM inside STM32L series microcontroller
     The STM32L series MCU provides an EEPROM storage area, but in fact, its FLASH is also an EEPROM type, but there is an area that is opened up for EEPROM operation. The STM32L EEPROM service life is designed to be more than 100,000 erase and write times, and the capacity is 2K-4K, which is ideal for parameter stora
[Microcontroller]
Analysis of three methods of 51 microcontroller analog serial port
With the increasingly frequent use of microcontrollers, using them as front-end processors for collection and communication is also common in various applications. Generally, front-end processors are used to collect various terminal data, process and store them, and then actively or passively report them to the manage
[Microcontroller]
Analysis of three methods of 51 microcontroller analog serial port
51 MCU burning detailed whole process
Software: Easy 51Pro v2.0; tool: 1.5V power supply; 2.Easy ISP download cable (For the production process, please refer to the article "Make your own Easy ISP download cable"; 3.51 single-chip microcomputer minimum experimental board (with light column), the production process refers to the article "Self-made
[Microcontroller]
51 MCU burning detailed whole process
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号