MCU Basics: Detailed Explanation of LED Interface Principles

Publisher:BlissfulMomentsLatest update time:2013-05-18 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Commonly used LED displays include LED status displays (commonly known as light-emitting diodes), LED seven-segment displays (commonly known as digital tubes), and LED sixteen-segment displays. Light-emitting diodes can display two states and are used for system status display; digital tubes are used for digital display; and LED sixteen-segment displays are used for character display.

1. Introduction to digital tube

1) Digital tube structure

The digital tube is composed of 8 light-emitting diodes (hereinafter referred to as segments), which can be used to display numbers 0 to 9, characters A to F, H, L, P, R, U, Y, the symbol "-" and the decimal point "." through different combinations. The appearance structure of the digital tube is shown in the figure below. The digital tube is divided into two structures: common cathode and common anode.

MCU Basics: Detailed Explanation of LED Interface Principles

[page]

2) Working principle of digital tube

The anodes (positive ends of diodes) of the 8 light-emitting diodes of the common anode digital tube are connected together. Usually, the common anode is connected to a high level (usually connected to the power supply), and the other pins are connected to the output end of the segment drive circuit. When the output end of a segment drive circuit is at a low level, the segment connected to this end is turned on and lights up. Various numbers or characters can be displayed according to different combinations of light-emitting segments. At this time, the segment drive circuit is required to absorb the rated segment conduction current, and the corresponding current limiting resistor needs to be determined according to the external power supply and the rated segment conduction current.

The cathodes (negative ends of diodes) of the eight light-emitting diodes of the common cathode digital tube are connected together. Usually, the common cathode is connected to a low level (generally grounded), and the other pins are connected to the output end of the segment drive circuit. When the output end of a segment drive circuit is at a high level, the segment connected to this end is turned on and lights up, and various numbers or characters can be displayed according to different combinations of light-emitting segments. At this time, the segment drive circuit is required to provide the rated segment conduction current, and the corresponding current limiting resistor needs to be determined according to the external power supply and the rated segment conduction current.

3) Digital tube font encoding

In order for the digital tube to display the corresponding numbers or characters, the segment data port must output the corresponding font code. Referring to Figure 7.10 (a), each bit of the font code is defined as follows: data line D0 corresponds to field a, D1 corresponds to field b, and so on. If a common anode digital tube is used, data 0 indicates that the corresponding field is bright, and data 1 indicates that the corresponding field is dark; if a common cathode digital tube is used, data 0 indicates that the corresponding field is dark, and data 1 indicates that the corresponding field is bright. To display "0", the font code of the common anode digital tube should be: 11000000B (ie C0H); the font code of the common cathode digital tube should be: 00111111B (ie 3FH). And so on.

2. Static display interface

Static display means that when a digital tube displays a certain character, the corresponding light-emitting diode is constantly turned on or off. Each digital tube in this display mode is independent of each other, and the common end is constantly grounded (common cathode) or connected to the positive power supply (common anode). The 8 fields of each digital tube are connected to an 8-bit I/O port address. As long as the I/O port has a segment code output, the corresponding character will be displayed and remain unchanged until the I/O port outputs a new segment code. With static display mode, a smaller current can achieve higher brightness, and it takes up less CPU time, is simple to program, and is easy to monitor and control. However, it occupies many port lines, has a complex hardware circuit, and is costly, so it is only suitable for occasions with fewer display bits.

3. Dynamic display interface

Dynamic display is to light up each digital tube one by one in turn. This method of lighting up the display bit by bit is called bit scanning. Usually, the segment selection lines of each digital tube are connected in parallel and controlled by an 8-bit I/O port; the bit selection line of each bit (common cathode or anode) is controlled by another I/O port line. When displaying in dynamic mode, each digital tube is selected in turn in time-sharing. To make it display stably, a scanning method must be adopted, that is, only one digital tube is selected at a certain moment, and the corresponding segment code is sent out, and another digital tube is selected at another moment, and the corresponding segment code is sent out. By following this regular cycle, each digital tube can display the characters to be displayed. Although these characters are displayed separately at different times, due to the visual persistence effect of the human eye, as long as the interval between each bit display is short enough, it can give people the feeling of simultaneous display.

The dynamic display method saves I/O ports and the hardware circuit is simpler than the static display method, but its brightness is not as good as the static display method. In addition, when the number of display bits is large, the CPU has to scan them sequentially, which takes up more CPU time.

Reference address:MCU Basics: Detailed Explanation of LED Interface Principles

Previous article:MCU Basics: Typical Keyboard and Display Interface Circuits
Next article:Simple MCU I/O port expansion example

Latest Microcontroller Articles
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号