Design of user-customized LED driver

Publisher:RadiantDuskLatest update time:2006-05-11 Source: 电子技术应用Keywords:bus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

      With the rapid development and widespread application of computer technology and electronic technology, the output display technology of electrical equipment has become complex and diverse, such as CRT display, LCD display, multi-digit LED display and light-emitting diode display. Among these displays, LED and light-emitting diode display circuits are relatively simple and low-cost, and are widely used in single-function instruments and electromechanical equipment. But when the device displays more points or bits, a certain driving circuit and corresponding driving method need to be used.
  
      In the design of LED driving and display units, there are many methods: using the port of the computer chip as the LED driving port, and implementing it through software programming and external driving. The disadvantage is that it takes up the time and related resources of the computer chip; using Special interface chips such as Intel8155, 8255, etc. are used as port extensions of computer chips and are implemented through software programming and external drivers. The disadvantages are that the circuit is more complex, the power consumption is large, and it also takes up the time and related resources of the computer chip; the use of dedicated interface chips for display Chips such as Intel8279, MAX7219, PS7219, etc. can implement more complex functions, but they still occupy a lot of computer chip ports, and the chip price is relatively high. Most display drivers do not have strict bus timing, which can easily lead to timing confusion and abnormal display in a strong interference environment. The LED display solution discussed in this article is to use the circuit characteristics of Philips' LPC series microcontroller chips to customize a dedicated LED display driver controller chip in another form. It mainly uses the communication interface based on the I2C bus to make the connection reliable; and controls the display based on software programming, making the display methods and types diverse. Due to the strong port driving capability of the LPC series chips, general LEDs can be connected directly, and multi-digit LEDs or a large number of light-emitting diodes can be displayed without additional components. When connected to other chips, the occupied I/O ports less. 

      1 4-digit 7-segment LED display

  
      The usual 4-digit LED display is shown in Figure 1. It is composed of multiple light-emitting diodes. According to different connection methods, it can be divided into common anode LED and common cathode LED. The circuit characteristics are basically the same: the light-emitting diode conduction voltage drop is 1.2V ~ 1.8V, and the forward operating current is 2mA ~ 15mA. In the display driver mode, dynamic scanning is used. When the n1~n4 common terminals are scanned, the LED driver outputs the display segments a~dp respectively, and the LED can display normally. Among the self-customized LED display driver chips, the P87LPC762 microcontroller chip in the LPC series has better port settings and stronger internal functions, so its pin functions can be set through programming as a driver chip for LED displays.


Figure 1 4-digit LED display



      2 Customized 4-digit 7-segment LED display driver chip

  
     To achieve 4-digit 7-segment LED display, you only need to make the current flowing through each segment of the light-emitting diode meet the requirements. Here, the P87LPC762 microcontroller of the LPC series of Philips Company is selected to implement the display drive circuit. P87LPC762 is an enhanced 51 series microcontroller. In addition to the functions of a general microcontroller, it also has the performance of driving LEDs:
  ·The I/O port has a pull-up output mode or an open-drain output mode setting, and can be used as a common cathode or a common anode. LED segment output and bit output.
  ·It has a large port to source or sink current, and has an internal short-circuit protection function to realize LED current driving.
  ·When designing a 4-bit LED driver, the remaining pins of the chip can be used for I2C bus address setting and LED polarity selection.
  ·There is 2K OPT inside, which can be used as program memory to implement interface and display programming.
  · Comes with I2C hardware interface, which facilitates interface programming and multi-chip connection.
  ·Internal watchdog and internal reset can improve the reliability of the driver display.
  ·Internal RC oscillator reduces external components.
  
     The pin functions of the P87LPC762 chip are shown in Figure 2. It has three ports: Port0, Port1, Port2. When internal oscillation and internal reset are selected, the maximum number of I/O ports can reach 18. Most ports can be configured through software into one of four types: quasi-bidirectional, pull-up, input, or open-drain output. For pull-up output mode, P87LPC762 adds a third transistor to the standard quasi-bidirectional port to provide a strong pull-up function, which can output a large pull-up current at high level; for open-drain output mode, the port can provide external Sinks large current; for input mode, port pin level is determined by external voltage.
  
     According to the display characteristics of the 4-digit dynamic LED, the port of P87LPC762 is defined here, and the pin definition is shown in Table 1. P0.0~P0.7 are used as segment outputs of 4-digit LEDs. Depending on the LED polarity, the port can be set to pull-up output or open-drain output; P1.0, P1.1, P1.6, and P1.7 are used as 4-bit LED segment outputs. For the bit output of the LED, the port can be set to open-drain output or pull-up output according to the LED polarity; P1.5 is used as the LED polarity selection and is set to input mode; P2.1, P2.0, P1.4 As an external address of the I2C bus, it is convenient to set the I2C bus address when connecting multiple chips and set it to input mode; P1.2 and P1.3 keep the I2C bus interface function unchanged. The defined chip pins are shown in Figure 3.


Figure 2 P87LPC762 chip original pin function?
 
Figure 3 P87LPC762 new customized chip pin definition


  To achieve the above chip settings, some internal special function registers and pin settings of P87LPC762 are shown in Table 2. PxMx is the port mode setting, which is selected according to the LED polarity. UCFG1 is the chip system configuration word, which needs to be written when programming the chip. It cannot be set after the program is run. When the configuration word is FBH, its meaning is: start watchdog, internal reset, port line is high level after reset, undervoltage is 2.5V, six Clock clocks, internal RC oscillator. 

      3. Customized 6-digit "meter" field LED display driver chip

  
     . Generally, the outline diagram of a 1-digit "meter" field LED display is shown in Figure 4, and its interior is composed of multiple light-emitting diodes. If you want to form a 6-digit "meter" field LED display, you need to connect the same segments and bits separately, and bring out the common terminal of each bit for dynamic scanning. According to the different connection polarities of light-emitting diodes, they can be divided into two methods: common anode and common cathode. Since the 6-digit "meter" field LED display has more output segments and digits, the P89LPC932 chip of the LPC series can be used to implement the display drive circuit. Its pins are in a 28-pin package. The maximum number of I/O ports can reach 26. The function leads The feet are shown in Figure 5. P89LPC932 has the same port electrical characteristics as P87LPC762 and has more I/O ports, so it can be used as a driver chip for a 6-digit "meter" field LED display. The pins of the newly customized driver chip are shown in Figure 6: a~n are drive segment outputs, n1~n6 are drive bit outputs; A/K is used as the selection end of common anode and common cathode; A0~A2 is used as I2C bus external address selection , can connect up to 8 external chips; SDA and SCL keep the I2C bus interface functions unchanged.


Figure 4 Outline

Figure 5 Original pin functions of P87LPC932 chip

Figure 6 P89LPC932 new customized chip pin definition
Table 1 Modified P87LPC762 port definition

pin Original pin function new definition illustrate pin Original pin function new definition illustrate
1 P0.0/CMP2 a LED
segment output
12 P1.0/TXD n1 LED
segment output
20 P0.1/CIN2B b 11 P1.1/RXD n2
19 P0.2/CIN2A c 2 P1.6 n3
18 P0.3/CIN1B d 3 P1.7 n4
17 P0.4/CIN1A e 4 P1.5/RST A/K polarity
16 P0.5/REF f 6 P2.1/X1 A2 Chip address
14 P0.6/CMP1 g 7 P2.0/X2 A1
13 P0.7/T1 dp 8 P1.4/INT1 A0
9 P1.3/SDA SDA I 2 C
interface
15 VDD VDD power supply
10 P1.2/SCL SCL 5 VSS VSS

Table 2 P87LPC762 chip settings

P1.5 P0M1 P0M2 P1M1 P1M2 P2M1 P2M2 UCFG1
Common anode LED ground FFH FFH 10H C3H 03H 00H FBH
Common cathode LED Connect to power 00H FFH D3H C3H 03H 00H FBH


      4 Application of customized LED display driver chip

  
      Taking the customized 4-bit 7-segment LED display driver chip as an example, the schematic diagram of the designed LED display driver is shown in Figure 7. It uses the general I/O ports P1.0 and P1.1 of the 89C52 microcontroller as the analog I 2 C bus; the LED display is a 4-bit common cathode LED, and the A/K pin is connected to the power supply; the display driver chip is customized using P87LPC762, named for LED-762. The external address of the I 2 C bus of the first chip is 000, which is achieved by grounding the A0, A1, and A2 pins. The addresses of the remaining chips are set in sequence, and up to 8 external chips can be connected (not shown in the figure). From the circuit diagram, LED-762 can be used as an LED driver without adding any external components. Because it uses I 2 C bus connection, it takes up the least system resources and the circuit is relatively simple. If 8 LED-762 are connected to the I 2 C bus, the number of LED expansion bits can reach 32 bits. For the application of "meter" field LED display driver chip, the same connection method can be used. On the same I 2 C bus, the maximum expandable "meter" field LED can reach 48 bits, which is enough to meet general use requirements.
  
      In order to improve the I 2 C bus driving capability, when implementing multi-chip connections, SCL and SDA need to be connected to bus matching pull-up resistors.       5 Software programming of customized LED display driver chip      Since the LPC series chip has an internal hardware interface that supports the I 2 C bus, users can directly use it as the master controller of the I 2 C bus or the slave controller of the I 2 C bus. The controlled controller can receive or send data from the bus through I 2 C hardware interrupt processing; the master controller operates the I 2 C bus to implement start timing, data timing, response timing, and stop timing to detect the controlled I 2 C bus. processor and implement corresponding data transmission. Controllers on the I 2 C bus are distinguished by their I 2 C bus addresses. The I 2 C bus address is uniformly allocated by the I 2 C bus committee. The chip address has a total of 7 bits (it occupies the D7~D1 bits). The high 4 bits (D7~D4) determine the chip type. The user can also customize the chip type. The lower 3 bits (D3~D1) are set through the chip A0, A1, and A2 pins.      When using the LPC series chip with I 2 C bus interface to customize the LED display driver chip, the customized LED display driver chip is set as the controlled device, and the CPU to send display data is set as the I 2 C bus master. The flow chart of the customized LED display driver chip receiving data through I 2 C interrupt is shown in Figure 8. When the first data is received from the I 2 C bus, it is judged whether it is the same address as the chip. If it is the same and it is writing display data, the response timing is sent to receive 4-bit display data, and then the I 2 C interface returns to the idle state. To realize LED dynamic display, the display program can be programmed for the LED display driver. According to the LED polarity input, the segments and bits to be displayed are sent out respectively, and the LED can display normally.
     

  

  

Figure 7 Schematic diagram of LED display driver using customized display driver chip

Figure 8 I 2 C interrupt flow chart


  According to the I 2 C bus protocol requirements, there are certain response time requirements for the data sent from the master controller. The shortest time can be determined by the multiplication frequency of the RC oscillator and the interrupt response time, and the maximum rate can reach 400kbs/s. The lowest rate can be controlled by the dedicated I 2 C timer I inside the LPC series. In order to adapt to non-standard low-rate I 2 C bus operations, the timer I can be turned off. 

      6 Chip test and main performance indicators

  
      According to the customization requirements, after the complete LED display driver and chip setting parameters are solidified through the programmer, a chip test connection diagram must be produced, as shown in Figure 7. Here, P1.0 and P1.1 of 89C52 are used as the analog I 2 C bus control lines to write the analog I 2 C driver. Moreover, the 89C52 host is reset again, the I 2 C bus communication is disconnected, etc., which will not affect the next normal data reception of the display driver. If the timer I in the customized LED driver is turned off, the simulated I 2 C program is paused and the customized LED driver can still drive the display normally through single-step debugging. Due to the strong output current capability of Philips' LPC series chip ports, when driving 0.5-inch common cathode and common anode LEDs, the LED brightness meets the requirements. When displaying at full brightness for a long time, the customized LED driver chip has a normal temperature rise and can work continuously for a long time. In actual use, control ports A/K and A0, A1, and A2 are set to input mode during programming, so when they are left floating, the input level is in an uncertain state and changes randomly, which may cause abnormal display. Set requirements and force connection to VCC or GND. 

      References

1 Zhang Yigang, Peng Xiyuan, Tan Xiaoyun, etc. MCS-51 microcontroller application design. Harbin: Harbin Institute of Technology Press, 1997 2
He Limin. I 2 C bus application system design. Beijing: Beihang University Press, 1995
3 Zhou Hang Ci. Principle and application design of 51LPC series OTP microcontroller. Beijing: Beijing University of Aeronautics and Astronautics Press, 2000

Keywords:bus Reference address:Design of user-customized LED driver

Previous article:Design of user-customized LED driver
Next article:Design of home smart box based on GP32 microcontroller

Recommended ReadingLatest update time:2024-11-16 19:53

Use of ioctl function in ARM driver development
0. The impact of Linux version on ioctl The ioctl function pointer in struct file_operations in fs.h has been completely deleted in kernel 2.6.36, and replaced by unlocked_ioctl  We will still use the ioctl pointer here, but when actually using it, you should pay attention to your Linux version. If it is 2.6.36 or
[Microcontroller]
Use of ioctl function in ARM driver development
"Driver separation" design idea of ​​microcontroller firmware
Today I have found with you a common design method of separating applications and drivers. It is still worth using for some current high-performance MCUs. However, it is not recommended for MCUs whose original main frequency is not high enough and whose performance is not strong enough. After all, this The design stil
[Microcontroller]
A design scheme for constant current LED drive system
  All LEDs, regardless of their color, size, or power, can fully perform as long as the driving current is constant. LED manufacturers will list the specifications of their products. For example, the data sheet will list the lumens, beam waveform, and color of the product when driven by a specified forward current (IF
[Power Management]
A design scheme for constant current LED drive system
Shiwei wide voltage 9-100V 2.6A step-down constant current driver IC LED car light solution
Application Information Output current The output current is sampled by the error amplifier inside the chip and compared with the internal reference voltage and the error is amplified, thereby achieving constant current control of the system. The output current formula is as follows: Iout=176mV/RCS
[Embedded]
Shiwei wide voltage 9-100V 2.6A step-down constant current driver IC LED car light solution
A boost converter operating in buck mode to drive white LEDs
The circuit shown in the figure provides a solution to drive high-power white LEDs, that is, using a standard boost converter working in "buck" mode to drive white LEDs. This solution has an efficiency of up to 96%, which has many practical advantages compared to the standard solution with an efficiency of only 85%.
[Power Management]
A boost converter operating in buck mode to drive white LEDs
A simple input subsystem program for Linux driver
In the brief analysis of the input subsystem of the Linux driver, we have analyzed the composition of the input subsystem. It is composed of the device layer, the core layer, and the event layer. The core layer provides some functions common to the device layer and the event layer, such as registration functions, un
[Microcontroller]
A simple input subsystem program for Linux driver
Reliability and electromagnetic compatibility test scheme for LED drivers (Part 3)
Test steps:   Electrostatic discharge testing requires the use of at least three samples at a time, and the static and dynamic parameters specified for each sample must be tested and recorded in advance.   ① Plug the evaluation load (short-circuit and R2) into the tester socket (A and B terminals) respectively; pl
[Analog Electronics]
Reliability and electromagnetic compatibility test scheme for LED drivers (Part 3)
LED drive power supply topology principle
In LED lighting applications using AC-DC power supplies, the building blocks of power conversion include discrete components such as diodes, switches (FETs), inductors, capacitors, and resistors to perform their respective functions, while pulse width modulation (PWM) regulators are used to control power convers
[Power Management]
LED drive power supply topology principle
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号