摘要
本文介绍了一种采用外部中断结合定时器控制的单总线传感器读写方法,该方法避免了传统阻塞读取方式中的系统资源长期占用。在需要长时间参数监测的应用中,能够有效利用系统资源,避免了阻塞过程中外部10和通讯信号进入后的处理滞后甚至遗漏,也避免了因为不确定的中断服务程序(ISR)造成了输出波形周期和脉宽的波动,避免了因为脉宽波动过大引起的通讯失败,具有稳定性高、占用资源少、无阻塞和定时精确的优点,有效提高了新型MCU的利用率,降低不必要的时伺开销,更符合MCU应用高速化和实时性的趋势。本方案均通过实验验证并应用于批量产品中,具有实际的工程意义。
A method of reading and writing one-wire bus sens0rcontrolled by external interrupt combined with timer is introducedin this paper.The long-tern occupancy of system resources intraditional blocking reading mode is avoided during this method.In applications requiring long-time parameter monitoring,system resources can be effectively utilized and processing lag or evenomission after external IO and communication signals enteredthe blocking process can be avoided.The fluctuation of output waveform cycle and pulse width whichis caused by uncertain interrupt serviceprogram(ISR),the communication failure which is caused by cxccssive pulse widthfluctuation also can be avoided.Withthe advantages of high stability,lowresource consumption.no blocking andaccurate timing.effectively inproves theutilization ratc of new MCU,unnecessarytimc overhcad is rcduced,and thcschcmes was made more in line with thctrend of MCU high specd and real-timeperformance.The schemes have becnvalidated experimentally and appliedin batch products,which has practicalengineering significance.
作者
夏铁铮
于虹博
XIA Tie-zheng;YU Hong-bo(Harbin Core Tomorrow Science&Technology Co.,Ltd.,Harbire 150080,Chinsa;Heilongjiang Inaternational Universisy,Hiarbin 150025,China)
出处
《传感器世界》
2020年第9期33-38,共6页
Sensor World