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
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
- Popular Resources
- Popular amplifiers
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Modern Product Design Guide
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- STM32MP157A-DK1 Review
- TouchGFX Design + Make a Rubik's Cube (3)
- Detailed analysis of static in C language
- Using MicroPython on Lego EV3
- 【Showing goods】The third wave
- High-speed DAC
- Aperture Tuning: An Essential Technology in 5G Smartphones
- 【RT-Thread Reading Notes】5 Chapter Reading Notes
- FPGA_100 Days Journey_AD Design
- What are some reasons why low-power op amps use pulsed power?