当前位置:网站首页>Design of piece counter based on 51 single chip microcomputer
Design of piece counter based on 51 single chip microcomputer
2022-06-30 17:02:00 【toyjis】
This project is based on 51 Piece counter of single chip microcomputer , The content of the project is : Realize the function of piece counter , This has practical significance for counting goods in the factory ; The detection distance is automatically set after the system is powered on 20cm, Objects less than this distance will cause the count to change and the buzzer to sound , Each object can only be triggered once ; Two nixie tubes are used to display the detection distance and the number of articles ; Use two keys to adjust the detection distance .
The project uses 51 Four interrupt sources of single chip microcomputer , Respectively : External interrupt 0, Timer interrupt 0, External interrupt 1, Timer interrupt 1. Basically, the foundation has been used up 51 All interrupt sources of the kernel , There is interrupt nesting between two timer interrupts , Is a good example of learning MCU interrupt !!
Project adoption Proteus Do simulation experiments , The following figure is the schematic diagram of the project , The ultrasonic sensor adopts HC-SR04(SRF04).
use ad The schematic diagram is drawn PCB, Layout size 8*9cm, Larger space , Easy to weld .

Part of the code is as follows , The main content of the project is : Nested use of interrupts 、 Sensor driver code 、 Nixie tube display code .
void start()// Ranging initialization
{
TR=1;
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
TR=0;
}
int getdistance(void)
{
start();
while(!ECHO);
TR1=1;
while(ECHO);
TR1=0;
time=TH1*256+TL1;
TH1=0;
TL1=0;
s=(time*1.7)/100; // Measured cm
if(flag==1||(s>700))
{
flag=0;
s=0;
return s;
}
return s;
}
The complete project includes :keilC The language code +Proteus Simulation schematic +ad Schematic diagram PCB+ Product specification
边栏推荐
- Multi terminal collaboration of Huawei accounts to create a better internet life
- On July 2, I invited you to TD Hero online conference
- Tencent two sides: @bean and @component are used on the same class. What happens?
- More dragon lizard self-developed features! Production available Anolis OS 8.6 officially released
- Jspreadsheet/ce JExcel: more data fields than the given fields (columns) will lead to blank columns. Solution
- Etcd教程 — 第八章 Etcd之Compact、Watch和Lease API
- Delete duplicates in an ordered array ii[double pointers -- unified in multiple cases]
- Deep learning - (2) several common loss functions
- geo 读取单细胞csv表达矩阵 单细胞 改列名 seurat
- JS Es5 can also create constants?
猜你喜欢

HMS core audio editing service 3D audio technology helps create an immersive auditory feast

The new tea drinks are "dead and alive", but the suppliers are "full of pots and bowls"?

【牛客网刷题系列 之 Verilog快速入门】~ 位拆分与运算

Deep learning - (2) several common loss functions

备战数学建模35-时间序列预测模型

redis数据结构分析

Symantec electronic sprint technology innovation board: Tan Jian, the actual controller, is an American who plans to raise 620million yuan

Mathematical modeling for war preparation 35 time series prediction model
![Halcon knowledge: regional topics [07]](/img/18/680997127047fb24b0ee4f19d8f2c5.png)
Halcon knowledge: regional topics [07]

TCP socket and TCP connection
随机推荐
2022蓝桥杯国赛B组-费用报销-(线性dp|状态dp)
[Verilog basics] octal and hexadecimal representation of decimal negative numbers
9:第三章:电商工程分析:4:【通用模块】;(待写……)
[machine learning] K-means clustering analysis
[Verilog basics] summary of some concepts about clock signals (clock setup/hold, clock tree, clock skew, clock latency, clock transition..)
商单视频播放超2000万!农院改造为何屡被催更?
Tutoriel etcd - chapitre 8 API compacte, Watch et lease pour etcd
Multi terminal collaboration of Huawei accounts to create a better internet life
RT-Thread 堆區大小設置
halcon知识:区域专题【07】
Bidding announcement: Tianjin housing provident fund management center database all-in-one machine and database software project (budget: 6.45 million)
Undistorted resize using pil
[demo] write file circularly
Home office discussion on the experience of remote assistance to quickly improve efficiency | community essay solicitation
Mathematical modeling for war preparation 33- grey prediction model 2
【机器学习】K-means聚类分析
[bjdctf2020]the mystery of ip|[ciscn2019 southeast China division]web11|ssti injection
[wechat applet] basic use of common components (view/scroll-view/wiper, text/rich-text, button/image)
2020 Blue Bridge Cup group B - move bricks - (greedy sorting +01 backpack)
您工厂的MES再不升级,就要被淘汰啦