当前位置:网站首页>51 single chip microcomputer controls nixie tube display
51 single chip microcomputer controls nixie tube display
2022-07-25 08:44:00 【Pear blossom presses Begonia】
Preface
Learning today 51 Digital tube module of single chip microcomputer
The digital tube on my learning board is 4 As a whole by 12 A pin controlled module .
Today, we will program and control it to display the output we want .
The nixie tube is essentially made of 8 individual LED Made by splicing , They are called a,b,c,d,e,f,g,dp( decimal point ). Control the lighting of these eight segments to display different results . Take the common cathode as an example ( Anode is 1 Then bright ),0 Namely abcdef bright ,g and dp destroy , Corresponding 8 Binary is 001 1111(a It's the lowest ). Namely 0x3f.
Here is given 0-8 Of 16 Binary code , It can be calculated and confirmed .
This kind of digital tube has a common feature , That is, one pole is connected ( Common cathode or common anode ), Control the nixie tube by controlling the other pole .
Old rules , First look at the circuit diagram

Here we can see that it is a common cathode .
Segment selection signal and a 38 Decoder connection ,E3 Is the enable signal ,Y0 To Y7 It's the output signal , adopt SEL0,SEL1,SEL2 Three signals control the output result .(SEL by 000 Corresponding Y0,SEL by 001 Corresponding Y1······SEL by 111 Corresponding Y7).
SEl Another chip pin P2 The lower three , We control P2 You can choose which nixie tube output , control P1 You can choose which of the nixie tubes LED Light on , This is the basic idea .
There is also a problem , Although this connection of the circuit saves a lot I/O Interface , But at the same time, only one nixie tube can have results . But the diode can be refreshed quickly , Take advantage of human visual persistence , As long as the refresh is fast enough , We can see them “ meanwhile ” Light up .(8 When two nixie tubes are on at the same time , We turn on the mobile camera , The camera is close to the digital tube , It is obvious from the mobile phone that the nixie tube is flashing and refreshing , If you don't believe it, you can have a try )
Put the code below : Print HNU–510
#include <STC15F2K60S2.H>
void Delay(unsigned int xms) //@12.000MHz
{
while(xms--){
unsigned char i, j;
i = 12;
j = 169;
do
{
while (--j);
} while (--i);
}
}
unsigned char duanxuan[]={
0x76,0x37,0x3e,0x40,0x40,0x6d,0x5b,0x3f};
unsigned char weixuan[]={
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07};
void main(){
P0M0=0xff;
P0M1=0x00;
P2M0=0xff;
P2M1=0x00;
while(1){
int k=0;
for( k=0;k<8;k++){
P0=duanxuan[k];
P2=weixuan[k];
Delay(2);
}
}
}
here duanxuan The array of is the hexadecimal code that you want to output characters ,weixuan Array from 0 To 7 control P2 The lower three . Using a loop can always refresh , Achieve the desired output .
Push-pull output should be set , Here is strong pull up . The first time I didn't write, the brightness of push-pull output nixie tube display was very low , The push-pull output is bright . And that is P2 All pins are used , So when setting push-pull output P2M0=0xff, Different from the previous use of P2.3 Of P2M0=0x80.
There is also a delay 2ms It also has its function , Because too fast refresh will lead to the combination of this segment selection signal and the last bit selection signal , Some places on the nixie tube that should not be bright will have a darker light . So we add a delay function to block this combination , This step is called “ Shadow elimination ”.


The picture above shows the situation without shadow elimination .
Now let's show the effect of my code :
It's clear , Net in vain , pure 、 good 、 The cute digital tube is really beautiful , Hey !
Postscript
The learning of digital tube display is about to end , It will be updated continuously .
If you have any questions, welcome to communicate .
To be continued ······
边栏推荐
- Django4.0 + Web + MySQL5.7 实现简单登录操作
- Initial knowledge of WebService (generate jar packages and call methods in remote services)
- Solutions to ten questions of leetcode database
- Basis 33: XPath acquisition methods of page elements under various browsers
- @Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
- The fifth day of MATLAB learning (cycle type)
- JVM specification Oracle official website
- Chapter 3 business function development (modifying clues, data echo and modifying data)
- Redis best practices
- Dependency conflict resolution under idea
猜你喜欢

51 MCU peripherals: Motor

Leetcode · 83 biweekly race · 6129. Number of all 0 subarrays · mathematics

51单片机内部外设:串口通信

How to do the game plug-in?

YOLOV5环境配置

Wechat sports ground reservation applet graduation design of applet completion works (3) background function

Fundamentals of C language

英特尔就产品延误向Xe HPG寻宝游戏获奖者道歉并公布奖品样貌

本周大新闻|FCC曝光Pico 4 VR一体机,雷朋母公司建立智能眼镜实验室

Data warehouse ODS, DWD floor, 220616, HM,
随机推荐
51 MCU peripherals: Motor
unity客户端读取文本配置
Rstudio shows that it can't connect to the web page, or it has a new website.
Memcached data cache database (improve efficiency)
The database of idea cannot prompt the table name, field name, and schema cannot be loaded
记录两次多端排查问题的过程
Dependency conflict resolution under idea
Wechat reservation of completed works of applet graduation project (4) opening report
Blue and white porcelain used by Charles
【黑马程序员】Redis学习笔记001:Redis简介+五种基本数据类型
Record the process of two multi terminal troubleshooting
Sina Weibo client (4) - set navigation bar theme
Qt|qlabole change line spacing when displaying multiple lines
51 MCU internal peripherals: timer and counter
Redis学习
递归调用实现打印一个整数的每一位
Database persistence +jdbc database connection
Wechat sports ground reservation applet graduation design of applet completion works (3) background function
Redis fragment cluster
PHP reports an error: classes\phpexcel\cell php Line(594) Invalid cell coordinate ESIGN1