摘要
超声波模块HC-SR04在MCS51单片机测试中,利用超声波模块返回的高电平来控制计数器的运行控制位TR,使能计数器进行计数,再通过公式运算得到距离。此方法会因其它中断影响计数器的计数准确性,导致测距的精度降低。因此本文提出利用计数器的门控方式解决其它中断对计数器影响,提高测距精度,并利用外部中断源判断计数完成并启动测距运算。
In the distance measurement of MCS51 with ultrasonic module HC-SR04,we use ultrasonic back signal to control the counter to count by the TR control bit,and obtain the distance by the formula calculation.This method can reduce the accuracy of the distance measurement because of the inf luence of other interrupt.Therefore,this paper puts forward the use of counter gating method to solve the influence of other interrupts in MCS51 system,improve the distance measurement accuracy,and use the external interrupt source to start the count of the distance calculation.
出处
《科技资讯》
2018年第11期92-93,95,共3页
Science & Technology Information
关键词
超声波模块
测距
计数器
精度
外部中断
Ultrasonic module
Distance measurement
Counter
precision
External interrupt