当前位置:网站首页>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
边栏推荐
猜你喜欢

安全帽佩戴检测算法研究

RT thread heap size Setting

Headhunter 50, 000, I'll go to VC

Raft introduction
![删除有序数组中的重复项 II[双指针--多情况统一]](/img/e2/cadfdbe476a86cb2d72c1ae0160a4a.png)
删除有序数组中的重复项 II[双指针--多情况统一]

Mathematical modeling for war preparation 33- grey prediction model 2

Etcd tutorial - Chapter 8 compact, watch, and lease APIs for etcd

Deep learning - (2) several common loss functions

备战数学建模35-时间序列预测模型
![[Verilog basics] summary of some concepts about clock signals (clock setup/hold, clock tree, clock skew, clock latency, clock transition..)](/img/54/fd7541dae4aad7e4216bcaabbb146b.png)
[Verilog basics] summary of some concepts about clock signals (clock setup/hold, clock tree, clock skew, clock latency, clock transition..)
随机推荐
[wechat applet] basic use of common components (view/scroll-view/wiper, text/rich-text, button/image)
nichenet实战silicosis
IO流_递归
dart:字符串replace相关的方法
坚果云-在新电脑上同步移动硬盘的文件
“推广+搞笑剧情”,如何碰撞出爆款的火花?
【Verilog基础】关于Clock信号的一些概念总结(clock setup/hold、clock tree、clock skew、clock latency、clock transition..)
The new tea drinks are "dead and alive", but the suppliers are "full of pots and bowls"?
RT-Thread 堆区大小设置
Research on helmet wearing detection algorithm
STL tutorial 7-set, pair pair pair group and functor
【机器学习】K-means聚类分析
CMakeLists 基础
IndexSearch
POJ Project Summer
Talk about telecommuting | community essay solicitation
BC1.2 PD协议
Additional: (not written yet, don't look at ~ ~ ~) webmvcconfigurer interface;
牛客网:乘积为正数的最长连续子数组
The meaning of linetypes enumeration values (line_4, line_8, line_aa) in opencv