当前位置:网站首页>Introduction to 51 Single Chip Microcomputer -- digital tube

Introduction to 51 Single Chip Microcomputer -- digital tube

2022-06-22 06:49:00 In the morning, the rain shines

1. Nixie tube

1.1. What is a digital tube ?

Digital display is called digital tube for short , It is an electronic device that can display numbers and other information . It is an indispensable device in digital display system , It is widely used , It's growing fast , The nixie tube is moving towards miniaturization 、 Planarize 、 Development in multifunction and low power consumption .

1.2. Types of digital tubes

There are three main categories of digital tubes .

  1. V-shaped overlapping digital tube . This kind of digital tube is characterized by different numbers 、 The electrodes of symbols such as letters overlap , When you need which symbol to display , Just drive the electrode of the symbol , Make it glow to show , At this time, other symbol electrodes do not emit light . This kind of digital tube has glow discharge tube and edge light display tube .
  2. Segmented digital tube . This kind of digital tube is characterized by dividing a number into several strokes , A certain number is displayed by driving the corresponding stroke to emit light , For example, fluorescent digital tubes are of this type . Segmented digital tube has two types: eight segment type and seven segment type . In digital display , Segmented digital tube is the main display device .
  3. Dot matrix digital display device . This kind of display is made up of some luminous dot matrix , Display numbers or characters with different arrangement and combination of luminous points , For example, the field luminescence digital board is such a display device .

If the light-emitting substance of the digital tube is different , Nixie tubes can be divided into the following 4 Types .

  1. Semiconductor digital tube . This kind of digital tube is made of semiconductor Light-emitting diode (LED) constitute , So it is also called LED digital tube , Or LED display . According to the connection mode of LED unit, it can be divided into common anode nixie tube and common cathode nixie tube . Connecting the common anode of the LED together to form a common anode (COM) My digital tube , In the application of Gongyang nixie tube, the common pole should be used COM Receive +5V, When the cathode of a field is low , The corresponding field lights up , When the cathode of a field is high , The corresponding field is not on . The common cathode digital tube refers to connecting the cathodes of all light emitting diodes together to form a common cathode (COM) My digital tube , In the application of common cathode nixie tube, the common pole should be used COM Connect to the ground wire GND On , When the anode of a field led is at high level , The corresponding field lights up , When the anode of a field is low , The corresponding field is not on . Pictured :
     Insert picture description here
    This kind of digital tube is also the most commonly used digital tube .

  2. Fluorescent digital tube . This is an electric vacuum device , Fluorescent digital tube 、 Electroluminescent digital board is such a display device .

  3. Liquid digital tube . Such as liquid crystal display 、 Electrophoretic display is such a display device .

  4. Gas discharge digital tube . For example, glow digital tube 、 Plasma display panel is such a display device .

1.3. Segmented LED digital tube

During digital display , Segmented digital tube display circuit is the most commonly used .

1.3.1 8-segment and 7-segment nixie tube stroke distribution

The left side of the figure below shows the distribution diagram of each segment of the eight segment nixie tube , The graph contains a~dp this 8 Paragraph stroke , On the right is the digital tube display 0 ~ 9 this 10 A sketch of a stroke when a number is .
 Insert picture description here
The following figure shows the distribution of each segment of the seven segment nixie tube , The only difference with paragraph 8 is that there is no decimal point in the lower right corner “dp” Insert picture description here

1.3.2.TTL Gate driven semiconductor digital tube circuit

The following figure shows the use of TTL Gate drive semiconductor digital tube circuit , In this circuit, only one driving circuit is drawn , The driving circuit of other sections is the same . Insert picture description here
When the decoder outputs high level 1 when , NAND gate A Output low level 0, So the LED VD1 Turn on and emit light . When the decoder outputs low level 0 when , NAND gate output high level 1, such VD1 It cannot be turned on or on . In circuit ,VD1 It is any section of LED in the nixie tube ,R1 Current limiting protection resistor . Which segments of LED in the nixie tube turn on and off is controlled by the decoder . The working voltage of semiconductor digital tube is low , It's usually 1.5~ 3V, So it can be directly driven by integrated gate circuit . The segment current of this kind of semiconductor digital tube is relatively large , It is several to ten milliamps .

1.3.3. Map recognition method

The LED digital display circuit mainly describes the following points .

  1. The figure below (a) Shown is a segmented digital display device composed of light-emitting diodes , This is a seven segment number Code display ,a ~ g There are seven strokes ,TP It's a decimal point . (b) The display circuit is shown ,A、B、C and D Is a binary digital input , The number is first input into the seven segment decoder circuit , Its output signals are respectively from 7 Outputs a ~ g Output , Add to respective drive triode base , The light-emitting diode of the stroke section is driven by the conducting triode . Insert picture description here
  2. The display device in the display circuit adopts a light-emitting diode , The driving circuit of LED is relatively simple , The circuit analysis shall be divided into the high level of the input driver 1 And low power flat 0 Two cases , adopt 1 or 0 Judge whether the drive tube is connected by the offset state of the drive tube . When the input signal gives a forward bias to the drive tube , The drive pipe is connected , LED light emitting display ; When the input signal reversely offsets the drive tube , Drive pipe stop , The LED does not light up to show .
  3. LED digital tube has many single LED or PN junction , They all have the same drive circuit , Drive respective light-emitting diodes , When analyzing the circuit, only one of the driving circuits should be analyzed .
  4. LED digital tube has strong brightness 、 High definition 、 Low voltage (1.5 ~ 3V)、 Good reliability 、 Small volume 、 Long life ( Greater than 1000h) Other advantages , The disadvantage is that the working current is still a little larger , Usually add one 470~800Ω Current limiting resistance of .

1.4. Fluorescent digital tube

Fluorescent digital tube is a segmented digital tube . The picture below shows YS-18-3 Outline and pin arrangement diagram of type a fluorescent digital tube . This is an eight segment fluorescent digital tube , chart (a) The outline diagram is shown , chart (b) The pin arrangement diagram is shown .
 Insert picture description here
Fluorescent digital tube is an electric vacuum device , Its working principle is similar to that of an ordinary electron tube , Its filament is the cathode ( It is a direct heating cathode ), When the filament is powered on, the filament will heat up ( Namely, cathode heating ), Because the cathode surface is coated with a layer of oxide with very small escape work , As a result, a large number of electrons will be emitted after the cathode is heated . A grid electrode is arranged in the fluorescent digital tube , The grid is provided with +20V DC voltage , The grid voltage is positive relative to the cathode , In this way, a large number of electrons emitted from the cathode are accelerated by the absorption of the positive grid electric field . The anode of the fluorescent digital tube is also connected +20V DC voltage ( In the actual circuit, the grid and anode are directly connected in the external circuit ), In this way, the vast majority of electrons accelerated by the electric field rush through the grid , Bombard the anode surface at high speed . The anode surface is coated with A layer of phosphor ( Zinc oxide material ), Phosphors emit light under the action of electrons bombarded at high speed .

The strokes in the fluorescent digital tube are the anode , So there are eight segment fluorescent digital tubes 8 Anodes . When one or several anodes are bombarded by high-speed electrons, they emit light , Can display a certain number . Which anodes are emitting light , This is controlled by the signal output from the decoder . The advantage of fluorescent digital tube is low working voltage , The driving current is small , The display is clear and pleasing to the eye , Big perspective , Good reliability , Long life , But the mechanical strength is poor , Inconvenient to use and install .

Because it is not often used in SCM , So I won't go into details .

1.5. Glow digital tube

The glow digital tube is a zigzag overlapping gas discharge display device . This kind of digital tube is different from the segmented digital tube , it Put various numbers or characters directly into the glass shell , A number or word is directly transmitted through a decoder and a driver circuit When the symbol is lit, it will display .

The following figure shows the schematic diagram of glow digital tube , chart (a) It shows SZ-1 The pin row of type a glow digital tube Schematic diagram , chart (b) This tube shows decimal numbers 8 Schematic diagram when . The shell of glow digital tube is made of transparent glass material , Short and fat , The pipe is filled with inert gas , No filament heating is required , Digital display by glow discharge .
 Insert picture description here
There is an anode in the glow digital tube a(② foot ), have other 10 A cathode k0 ~ k9, They are numbers 0 ~ 9, Each of them has a pin connected to the outside of the shell . When the glow digital tube works , The anode is connected with +180V DC voltage , When a cathode is grounded in an external circuit , Between the cathode and the anode +180V DC voltage , Thus, a gas discharge is performed between the anode and the cathode , At this time, the grounding cathode The pole can emit orange glow numbers , Achieve the display purpose . When one cathode is grounded , Other cathodes are in suspension or high potential state , Their cathodes do not glow .

Because it is not often used in SCM , So I won't go into details .

2. Digital tube simulation

2.1. BCD- Seven segment display decoder 7448

7448 Internal logic diagram of the chip (a) And logic block diagram (b):
 Insert picture description here
The main control circuit of the chip is working state and extended function . It mainly plays the function of simplifying logic for the nixie tube , stay 1.3.3. The driver chip in is 7448. stay Proteus 8 Professional Medium 7SEG-BCD Nixie tube is a common cathode nixie tube and 7448 Put it all together . Pictured :
 Insert picture description here
The four pins are... From left to right 7448 Of A3 ~ A0 .

stay Proteus 8 Professional Establish the schematic diagram as shown in the figure :
 Insert picture description here Simulation video link of the above schematic diagram

2.2. Digital tube static display

2.2.1. Touch the switch and key to eliminate chattering

 Insert picture description here
The light touch switch is a mechanical elastic switch , When the mechanical contacts open 、 Due to the elastic action of the mechanical contact when closing , When a key switch is closed, it will not turn on stably immediately , When it is disconnected, it will not be disconnected at once . Because the closing and opening moments are accompanied by a series of jitters ( Here's the picture ), This jitter may cause our chips to make wrong judgments , In order not to produce this kind of phenomenon, we call it key shake elimination .  Insert picture description here
In order to solve the key jitter, we have two methods: software and hardware .
Hardware dithering : seeing the name of a thing one thinks of its function , Add components to the circuit to eliminate chattering , For example, the capacitance of the reset circuit , or RS trigger , Pictured : Insert picture description here
 Insert picture description here
Software deblurring : We add a delay function when using a switch , Skip the unstable time of the level :

void delay()
 {
    
 	uint i;
	for(i = 0 ; i < 123 ; i ++);
 }
 void key()
 {
    
 	if(KEY0 == 0{
    
 		delay();
 		if(KEY0 == 0{
    
 		...........
 		}
 	}
 }

Or use the following method , When the switch is pressed a Add one , To determine a And switch status , This method is applicable to short press , It doesn't apply to long press for seconds .

void key()
 {
    
	if(key0 == 0 && a == 0)
	{
    
		a = 1;
	}
	if(a == 1 && key0 == 1)
	{
    
		a = 0;
		sum++;
	}
 }

2.2.2. Schematic diagram and code

 Insert picture description here
stay Proteus 8 Professional Draw the schematic diagram shown in the above figure in .

Then start writing programs .

#include<reg52.h> // This file defines some special function registers of MCU 
#define uint unsigned int // Declare and define data types 
#define uchar unsigned char // Declare and define data types 
sbit key0 = P1^0;			//  Bit address declaration  , Be careful :sbit  Must be in lowercase  ,P Capital must be written. 
uint s[] = {
    0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x40,0x40,0x80,0x00};	// Common cathode nixie tube 0~9 、 A~F 、 - 、 .  Extinguish 
uint sum = 0; 		// Define an unsigned integer variable  unsigned int  The data range of is 0~65535(2^16 - 1)
uchar a=0;			// Define unsigned character variables  unsigned char  The data range of is 0~255(2^8 - 1)

void delay(uint n)		//  The time delay function , About time delay  n ms
 {
    
 	uint i,j;
	for(i = 0 ; i < n ; i ++)
	{
    
		for(j = 0 ; j < 123 ; j ++);
	}
 }

void key()   //  Button function  , Press the switch to change the nixie tube 
 {
    
	if(key0 == 0 && a == 0)
	{
    
		a = 1;
	}
	if(a == 1 && key0 == 1)
	{
    
		a = 0;
		sum++;
	}
 }

void seg()	//  Nixie tube display function 
 {
    
 	P2 = s[sum];
	if(sum == 18)
	{
    
		sum = 0;
	}
 }

void main()
 {
    
 	while(1)
	{
    
		key();
		seg();
	}
 }

The above program simulation video link

2.3. The dynamic display of digital tube

When multiple nixie tubes display numbers , In fact, it turns on the nixie tube ( That is, only one nixie tube is on at a time ), Using the visual persistence of the human eye ( Also called afterglow effect ), It can be seen that all digital tubes are on at the same time , This is dynamic display , Also called dynamic scanning .

If there are two digital tubes , To display the “12” This number , Let the high digital tube be connected first , Then control the single-chip microcomputer I/O Let it show “1”, After a certain time delay, the low-level digital tube will be turned on , Control of single chip microcomputer I/O Let it show “2”. This process can be cycled at a certain speed to make the digital tube display “12”, Because the alternation speed is very fast , What the human eye recognizes is “12” The two numbers light up at the same time .
Pictured : Insert picture description here

Code :


#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int

uchar s[]={
    0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};	   // Common cathode nixie tube 0~9 
uchar t0 = 0 ,t1 = 0 , t2 = 0 , t3 = 0 , t4 = 0 , t5 = 0 ;			   
uchar b = 0 , c = 0 , d = 0;

void delay(uint n)			   // The time delay function ( Run an empty project to delay time )
{
    
	uint i,j;
	for(i = 0 ; i < n ; i ++)
	{
    
		for(j = 0 ; j < 120 ; j ++);
	}	
}

void display1()						   // Display... On the nixie tube 
{
    
	P2 = 0x7f ;				  //P2^7 Low level  0111 1111  Control the first nixie tube  
	P0 = s[t0] ;			
	delay(1) ;				  // The delay is about 1ms
	P2 = 0xbf ;				  //P2^6 Low level  1011 1111  Control the second nixie tube  
	P0 = s[t1] ;			 
	delay(1) ;
	P2 = 0xdf ;				  //P2^5 Low level  1101 1111  Control the third digital tube  
	P0 = 0x40 ;				
	delay(1) ;
	P2 = 0xef ;				  //P2^4 Low level  1110 1111  Control the fourth digital tube  
	P0 = s[t2] ;			 
	delay(1) ;
	P2 = 0xf7 ;				  //P2^3 Low level  1111 0111  Control the fifth digital tube  
	P0 = s[t3] ;			  // Used to display “ branch ” A bit of 
	delay(1) ;
	P2 = 0xfb ;				  //P2^2 Low level  1111 1011  Control the sixth nixie tube  
	P0 = 0x40 ;				 
	delay(1) ;
	P2 = 0xfd ;				  //P2^1 Low level  1111 1101  Control the seventh digital tube  
	P0 = s[t4] ;			 
	delay(1) ;
	P2 = 0xfe ;				  //P2^0 Low level  1111 1110  Control the eighth digital tube  
	P0 = s[t5] ;			 
	delay(1) ;	
}



void main()					  // The main function 
{
    
	while(1)
	{
    
		display1();
	}	
}
原网站

版权声明
本文为[In the morning, the rain shines]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220545510912.html