51 single chip microcomputer static digital tube display

Publisher:捡漏来了Latest update time:2020-04-03 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Physical picture of digital tube:

No matter how many digital tubes are connected together, the display principle of the digital tube is the same, which is to light up the internal light-emitting diodes. Let's explain how a digital tube lights up. The internal circuit of the digital tube is shown in the figure below. As can be seen from the right figure, a digital tube has 10 pins. It takes 7 small segments to display an 8, and there is also a decimal point, so there are a total of 8 small light-emitting diodes inside, and finally there is a common terminal. In order to unify the packaging, manufacturers package 10 pins for single-digit digital tubes, of which the 3rd and 8th pins are connected together. Their common terminals can be divided into common anode and common cathode. The middle figure is the internal schematic diagram of the common anode, and the right figure is the internal schematic diagram of the common cathode.

The figure above shows the pin arrangement and internal structure of two commonly used digital tubes. As we all know, lighting up a light-emitting diode means giving it a sufficiently large forward voltage drop. So lighting up a digital tube is actually giving it a forward voltage drop for the corresponding light-emitting diode inside it. As shown in the left figure above (a, b, c, d, e, f, g, DP eight segments in total), if you want to display "1", you need to light up the two segments of LED b and c; if you want to display "A", you need to light up the six segments of LED a, b, c, e, f, g; we also know that since the LED is loaded with a forward voltage drop, the voltage at both ends of it must be high or low: if the end with a high voltage of the eight-segment LED is the common end, we call it a common anode digital tube (as shown in the figure above); if the end with a low voltage of the eight-segment LED is the common end, it is called a common cathode digital tube (the right figure above). Therefore, to light up a common anode digital tube, you need to give a higher level at the common end than at the non-common end; conversely, to light up a common cathode digital tube, you need to give a higher level at the non-common end.


For common cathode digital, the cathodes of the 8 LEDs are all connected together inside the digital tube, so it is called "common cathode", and their anodes are independent. Usually, the cathodes are grounded when designing the circuit. When we add a high level to any anode of the digital tube, the corresponding LED lights up. If you want to display an 8 and light up the decimal point in the lower right corner, you can send a high level to all 8 anodes. If you want it to display a 0, then we can send a high level to all the pins except the two "g, dp" with a low level, so that it will display the word 0. If you want it to display a number, send a high level to the corresponding LED. Therefore, when displaying numbers, the first thing we do is to encode the ten numbers from 0 to 9, and when you want it to light up a certain number, just send this code to its anode.


All anodes of the 8 LEDs inside the common anode digital tube are connected together. When the circuit is connected, the common terminal is connected to a high level, so the LED diode we want to light up needs to send a low level to the cathode. At this time, the code of the displayed number is opposite to the common anode code. When the LED inside the digital tube is lit, it also requires a current of more than 5mA, and the current should not be too large, otherwise the LED will burn out. Since the I/O port of the microcontroller cannot send such a large current, a driving circuit needs to be added when the digital tube is connected to the microcontroller. The pull-up resistor method or a special digital tube driver chip can be used. The 74HC573 latch is used on this experimental board. It has a large output current and a simple circuit interface, which can be used for reference.


Common anode digital tubes are more commonly used. Why? This is because the non-common end of the digital tube is often connected to the IO of the IC chip, and the driving ability of the IC chip is often relatively small. If a common cathode digital tube is used, its driving end is at the non-common end, and it may be limited by the insufficient output current of the IC chip and display dim (such as 51 single-chip microcomputer), and an external pull-up resistor or triode is required to increase the driving ability. Therefore, the advantage of using a common anode digital tube is that the work of driving the digital tube is handed over to the common end (usually connected to the driving power supply), and increasing the power of the driving power supply is naturally much simpler than increasing the driving current of the IC chip IO port. On the other hand, this can also reduce the burden on the MCU.


When multiple digits are in one, their internal common ends are independent, while the segment lines responsible for displaying certain numbers are all connected together. The independent common end can control which digital tube in the multi-digit device lights up, while the segment lines connected together can control what number the digital tube lights up. Usually we call the common end a "bit select line" and the segment lines connected together a "segment select line". With these two lines, any digital tube can be controlled to display any number through a single-chip microcomputer and an external drive circuit.


Generally, a single-digit digital tube has 10 pins, a two-digit digital tube also has 10 pins, and a four-digit digital tube has 12 pins. You can look up relevant information about the specific pins and segment and bit numbers. The easiest way is to measure with a digital multimeter. If you don’t have a digital multimeter, you can also use a 5V DC power supply connected in series with a 1k resistor and then measure. Record the measurement results and draw the pin numbers through statistics.


Digital tube static display


When multiple digital tubes are applied to a system, their "bit select" can be controlled independently, while the "segment select" is connected together. We can control which digital tubes light up through the bit select signal. At the same time, the numbers displayed on all the digital tubes selected by the bit select are always the same. Because their segment select is connected together, the segment select signals sent to all digital tubes are the same, so the numbers they display must be the same. This display method of digital tubes is called static display.

As can be seen from the circuit diagram, this development board uses a common anode digital tube, and a 470R current-limiting resistor is added to each digital tube end.


The connection diagram of the single-chip static digital tube display experiment is as follows:

The sample program is as follows:


   #include "reg52.h"

 

   typedef unsigned char u8;

   typedef unsigned int u16;

 

   u8 code smgduan[16]= {0x3f, 0x06, 0x5b, 0x4f,

                    0x66, 0x6d, 0x7d, 0x07,

0x7f, 0x6f, 0x77, 0x7c,

0x39, 0x5e, 0x79, 0x71}; // 0~f 16 numbers

 

  u8 k = 0;

 

   void delay1s(u8 x) //delay function

   {

    u16 i=0;

u16 j=0;

for(;i < x*14665; i++)

   for(;j < 10000; j++)

   ;

   }

 

   void main()

   {

   P0 = ~smgduan[0]; //display 0

   while(1)

   {

   for(;k < 16; k++)

   {

      P0 = ~smgduan[k]; //Display 16 numbers from 0 to f

  delay1s(1); //delay

   }

   k = 0;  

   }

   }


Reference address:51 single chip microcomputer static digital tube display

Previous article:51 single chip microcomputer - digital tube driver
Next article:51 single chip microcomputer dynamic digital tube display

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号