文件名称:test18b20
介绍说明--下载内容来自于网络,使用问题请自行百度
由于DS18B20是单线操作,所以必须严格遵守它的时序要求才能正常与之建立联系并实现读写操作。
网上见到的多是程序多是在主程序中以延时的方式实现,而且要求关中断,以实现18B20对时序的要求。但是实际应用中,测温操作一般是作为辅助动作,主要任务是通信及数据处理等其他操作,这样一来,如果将DS18B20的程序代码放在主程序中,势必影响其他需要实时处理的中断。
前些天玩到DS18B20,就尝试以51定时中断的方法实现DS18B20时序,在面包板上成功跑了起来。
用的单片机是STC11F16XE,使用外部晶振24MHz。-As DS18B20 is a single operation, so it must be strictly complied with the timing requirements in order to establish contact with them and achieve normal read and write operations. Online programs are mostly seen mostly in the main way to delay implementation, and requires disable interrupts to achieve 18B20 right timing requirements. However, practical applications, operating temperature is generally used as auxiliary action, the main task is communication and data processing and other operations, so that, if the DS18B20 program code on the main program, is bound to affect other needs real-time processing of interrupts. A few days ago to play to the DS18B20, just try to 51 timer interrupt method to achieve DS18B20 timing, success in the bread board ran. SCM is used STC11F16XE, using an external crystal 24MHz.
网上见到的多是程序多是在主程序中以延时的方式实现,而且要求关中断,以实现18B20对时序的要求。但是实际应用中,测温操作一般是作为辅助动作,主要任务是通信及数据处理等其他操作,这样一来,如果将DS18B20的程序代码放在主程序中,势必影响其他需要实时处理的中断。
前些天玩到DS18B20,就尝试以51定时中断的方法实现DS18B20时序,在面包板上成功跑了起来。
用的单片机是STC11F16XE,使用外部晶振24MHz。-As DS18B20 is a single operation, so it must be strictly complied with the timing requirements in order to establish contact with them and achieve normal read and write operations. Online programs are mostly seen mostly in the main way to delay implementation, and requires disable interrupts to achieve 18B20 right timing requirements. However, practical applications, operating temperature is generally used as auxiliary action, the main task is communication and data processing and other operations, so that, if the DS18B20 program code on the main program, is bound to affect other needs real-time processing of interrupts. A few days ago to play to the DS18B20, just try to 51 timer interrupt method to achieve DS18B20 timing, success in the bread board ran. SCM is used STC11F16XE, using an external crystal 24MHz.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
test18b20.c
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.