文件名称:test18b20
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2013-08-10
- 文件大小:
- 3kb
- 下载次数:
- 0次
- 提 供 者:
- T**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
由于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