Digital tube usage

Source: Internet
Author: User

Digital tube is a commonly used module in embedded development. This article is based on my recent documents and study notes, to explain the principles and usage of commonly used digital tubes in as much detail as possible. If there are any deficiencies or omissions, please do not correct them.

Directory

1. Working Principle

2. Electrical Properties

3. Driver Mode

4. Development Instance

5. brightness and latches

6. precautions during use


I. Working Principle

Digital tube is a semiconductor light-emitting device. Its basic unit is light-emitting diode. The four-digit digital display is called a four-digit digital tube. Of course there are multiple and only one digital tube. Their electrical principle is the same. Digital tubes are divided into seven-segment digital tubes and eight-segment digital tubes by segment. The eight-segment digital tube has one more led Unit (one decimal point) than the seven-segment digital tube ); according to the connection mode of the Light Emitting Diode unit, they can be divided into a co-anode digital tube and a co-cathode digital tube. Co-yang digital tube refers to the digital tube that connects all the anode of the light-emitting diode together to form a public anode (COM. When using the common Yang digital tube, the public pole COM should be connected to + 5 V. When the cathode of the light emitting diode in a certain field is low, the corresponding field will be lit. When the cathode of a certain field is high, the corresponding field is not bright. A common overcast digital tube is a digital tube that connects the cathode of all light emitting diodes to form a public cathode (COM. When using the common overcast digital tube, the public pole COM should be connected to the ground Gnd. When the anode of a certain field of the Light Emitting Diode is high, the corresponding fields will be lit. When the anode of a field is low, the corresponding field is not bright.



Ii. Electrical Characteristics

The Unit digital tube has ten pins, eight of which are used to light up a, B, c, d, e, f, DP, a total of eight light emitting diodes (principles are described in this article ), the 3, 8 pins are public com pins. They are connected and act the same and can be connected to any one. For a clearer introduction, the textures are as follows:



Iii. Driver Mode

1. Static drivers are also called DC drivers. Static Driving means that each segment code of each digital tube is driven by an I/O port of a single-chip microcomputer, or is driven by decoding with a binary-decimal decoder such as BCD code. The advantage of the static driver is that the programming is simple and the display brightness is high. The disadvantage is that it occupies many I/O Ports, for example, if you want to drive the static display of five digital tubes, you need 5x8 = 40 I/O ports to drive them. You need to know that only 32 I/O ports are available for a single-chip microcomputer 51 :), in actual application, the decoder driver must be added for driving, increasing the complexity of the hardware circuit.

2. The digital tube dynamic display interface is one of the most widely used display methods in single-chip microcomputer. The dynamic drive is to display 8 strokes of all digital tubes "a, B, c, d, e, F, G, DP "are connected together with the same name. In addition, the bitwise control circuit is added for the public pole com of each digital tube, bit selection is controlled by independent I/O Lines. When the single-chip microcomputer outputs the font code, all digital tubes receive the same font code, but the digital tube displays the font, it depends on the control of the matching circuit of the single-chip microcomputer through the com end. Therefore, we only need to open the control of the digital control to be displayed, and this bit will display the font, digital tubes that do not have access are not highlighted. By controlling the com end of each digital tube in turn in a time-sharing manner, various digital tubes are displayed in turn, which is a dynamic drive. During the rotating display process, the lighting time of each digital tube is 1 ~ 2 ms. Due to the temporary visual effect of people and the afterglow effect of light emitting diodes, although you don't actually light up your digital tubes at the same time, as long as the scanning speed is fast enough, the impression is that a set of stable display data does not flash. The dynamic display effect is the same as the static display, which can save a lot of I/O Ports, and lower power consumption.


4. Development Instance

The following describes the dynamic driver display of the four digital tubes. The wiring pin diagram is as follows.



Next, we will use 51 Single-Chip Microcomputer Design goals: Compile the C language program and download it to the single-chip microcomputer after compilation, so that the four digital tubes will display 1, 2, 3, 4 in turn

# Define uchar usigned char # define uint usigned int // The bitwise control port sbit P20 = P2 ^ 0; sbit P2 = P2 ^ 1; sbit P22 = P2 ^ 2; sbit P23 = P2 ^ 3; // The encoded array of the digital tube segment, which is displayed as the uchar code bianma [] = {0x7, 0xb, 0xd, 0xe}; // 1 ms latency function (for digital tube Dynamic Refresh) void delay1ms (INT time); void main () {While (1) {P20 = 0; // effective for selecting a low position of the common cathode digital tube, indicating that the first digital tube p0 = bianma [0] has been selected; // use the I/O port p0 to send the segment selection encoding delay1ms (500) to the digital tube ); // The first digital tube is displayed for 0.5 seconds, and then switched to the second digit. The four digits are displayed P20 = 1 because of the visual stay and the afterglow of the digital tube; // second bright p0 = bianma [1]; delay1ms (500); p21-p22 = 0; // third bright p0 = bianma [2]; delay1ms (500); P22 = 1; P23 = 0; // The fourth highlighted p0 = bianma [3]; delay1ms (500); P23 = 1 ;} // The Void delay1ms (INT time {int I, j; for (I = time; I> 0; I --) for (j = 110; j> 0; J --)}
V. brightness and latches

Generally, the brightness of the static drive is higher than that of the dynamic drive, but it does not affect the usage. In practice, in order to achieve better results, it will be used together with latches such as 74hc573 to remember previous State data until new data is overwritten. For 51 Single-Chip Microcomputer Application Development, compared with LCD, LCD module programming is more convenient and the style is more diverse, but its disadvantage is that the brightness is not enough. This is precisely the advantage of digital control. If you do a simple counting display, digital control is the best choice.

Vi. precautions during use

The basic component of the digital tube is a light-emitting diode, so the current that can pass is only a few Ma, when connected to a 5 v dc power supply for testing, it must be stringed with a resistance of dozens of K. Otherwise, it is easy to burn. In addition, you can use a multimeter to test the resistance file to light it up, which is enough to show that the current is small.


Digital tube usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.