当前位置:网站首页>(3) Dynamic digital tube
(3) Dynamic digital tube
2022-06-26 08:19:00 【I love notes】
This chapter will talk about the relevant contents of dynamic digital tube , In fact, from the front gpio And buzzer , We basically just learned a little about a single gpio Use , In this section, let's review the whole group gpio Operation method . Before memories , You still need to add some knowledge to .
1. About digital tube
First, about the digital tube , In fact, it's very simple , A digital tube actually means that there are many led The lights need to be operated at the same time , It's a group gpio All to low level or high level , There is actually a little distinction here , When designing your digital tube, do you connect all the cathodes together or do you connect all the anodes of the digital tube together , If all the anodes are connected together, it means a common anode digital tube , On the contrary, it is a common cathode digital tube , See your chip manual for this , Or use a multimeter to measure , See the following development for the test method , My digital tube is a common cathode digital tube , If we connect this common cathode to the ground , And we give them each anode to high and low levels , In fact, you can display a complete number . The multi digit nixie tube is a multi digit nixie tube , But its structure is basically similar to that of using multiple one bit digital tubes , Just take my 4 Take the digital tube for example , See the picture below :

2. Hardware
From the above figure, we can see that the top here is the common cathode of each digital tube , We generally call this section route selection , We just need to select one and give it a low level , Then all the other lines below us give us some high levels for the bits we want , Then our digital tube can light up and become the number we want . You may notice that we give a Level corresponds to a Bit will be lit . And about 74HC245 chip , The first thing we should say about each chip is to check its chip manual , First of all, why do we need 74HC245 This chip ? In fact, this is very similar to what we talked about in the previous section , That is to say 51 The driving ability of single chip microcomputer is not good , We need to add drive capability to it , Here we add 74HC245 Why , We don't need to configure it , Because we have made the corresponding configuration on the hardware , to DE Pin a low level to enable , That means making the chip work , And vcc If you give a high level, you can start from A To B Output , In this case, the hardware of the digital tube is almost the same , But the above line selection is not directly connected to gpio above , Instead, I chose to receive 38 On the decoder , As shown in the figure below

In fact, the best way is to see it at this time 38 Decoder chip manual , I'll just talk about its features here , Let's just copy its truth table .

there A0,A1,A2 Corresponding to the above figure respectively A,B,C,E1,E2,E3, They correspond to each other G1,G2A,G2B, Because of what we have here E1,E2,E3 The status has been established , Then we just need to go through A,B,C To complete the function , As shown in the figure above ,L For low level ,H For high level ,X Represents any state , Because of our E1,E2,E3 The state of has been determined , So let's start with the fourth line , It means that we pass through A、B、C You can choose Y The state of , Let the corresponding Y Bit output low level , You can select the corresponding nixie tube .
3, Software
We are now writing a simultaneous display program for the nixie tube 0 To 7 The relevant contents of the data , The code is as follows :
#include <reg52.h>
sbit LSA = P2^2;
sbit LSB = P2^3;
sbit LSC = P2^4;
unsigned code smgduan[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};//0x0~0xf
/* Delay time */
void delay(int x){
while(x--);
}
void main(){
int i;
while(1){
for(i = 0;i < 8;i++){
switch(i){
case 0:
LSA = 0; LSB = 0; LSC = 0;
break;
case 1:
LSA = 1; LSB = 0; LSC = 0;
break;
case 2:
LSA = 0; LSB = 1; LSC = 0;
break;
case 3:
LSA = 1; LSB = 1; LSC = 0;
break;
case 4:
LSA = 0; LSB = 0; LSC = 1;
break;
case 5:
LSA = 1; LSB = 0; LSC = 1;
break;
case 6:
LSA = 0; LSB = 1; LSC = 1;
break;
case 7:
LSA = 1; LSB = 1; LSC = 1;
break;
}
P0 = smgduan[i];
delay(10); // Delay
P0 = 0x00; // Shadow elimination
}
}
}In addition to the previous introduction to our program , The most important one is about delay , The delay should not be too long , If it is too long, it will not be displayed at the same time , In fact, our simultaneous display is time-sharing , But our eyes are not so fast , It looks like it is displayed at the same time , It is the same reason that we watch TV , The later shadow elimination is mainly for , Eliminate residual shadow . And the array of numbers is directly calculated by me one by one .
4. Expand the content
About how to use a multimeter to measure the voltage of a digital tube , The multimeter uses the gear of the voltmeter , We can choose any two pins to measure the voltage between them , As long as the voltage between them is 1.5v, Then connect one end to the other pin , You can know whether the digital tube is a common anode or a common cathode , In fact, there is no multimeter. In fact, after analyzing the circuit diagram, it will come out , You can see from my circuit diagram that it is a common cathode , I still can't , Turn to the corresponding manual , It's OK, too .
边栏推荐
- Chapter VI (pointer)
- Necessary protection ring for weak current detection
- I want to open a stock account at a discount. How do I do it? Is it safe to open a mobile account?
- Uniapp wechat withdrawal (packaged as app)
- Pychart connects to Damon database
- Discrete device ~ diode triode
- CodeBlocks integrated Objective-C development
- Bluebridge cup 1 introduction training Fibonacci series
- Use intent to shuttle between activities -- use explicit intent
- Quickly upload data sets and other files to Google colab ------ solve the problem of slow uploading colab files
猜你喜欢

Getting started with idea

Design of reverse five times voltage amplifier circuit

"System error 5 occurred when win10 started mysql. Access denied"
![Comparison version number [leetcode]](/img/02/d1a1922c10e5360e511782b16690e1.jpg)
Comparison version number [leetcode]

Automatic backup of MySQL database in the early morning with Linux

Ping An technology's practice of migrating from Oracle to ubisql

Rewrite string() method in go language
![[postgraduate entrance examination] group planning exercises: memory](/img/ac/5c63568399f68910a888ac91e0400c.png)
[postgraduate entrance examination] group planning exercises: memory

Data governance: from top project to data culture!

Double linked list -- tail interpolation construction (C language)
随机推荐
1002: easy to remember phone number
Double linked list -- tail interpolation construction (C language)
JMeter performance testing - Basic Concepts
Uni app is similar to Taobao in selecting multiple specifications of commodities (inventory judgment)
Arrangement and insertion structure
Uniapp wechat withdrawal (packaged as app)
The solution of installing opencv with setting in pycharm
Database learning notes I
The 9th zero code training camp is officially open for registration! (Beijing, Shanghai, Guangzhou and Shenzhen)
监听iPad键盘显示和隐藏事件
Uniapp uses uviewui
Solve the problem that pychar's terminal cannot enter the venv environment
Read excel table and render with FileReader object
Hand drawn style chart library chart Implementation principle of xkcd
golang json unsupported value: NaN 处理
[untitled]
Undefined symbols for architecture i386 is related to third-party compiled static libraries
MySQL practice: 3 Table operation
JS precompile - Variable - scope - closure
Interview ES6