-
Recent Posts
Recent Comments
- skylinejin on 超懒的程序员用 BlazeDS +JAVA+ db4o 来搭建应用
- 灰太狼 on 关于数字电位器
- 灰太狼 on 关于数字电位器
- 绮荷 on 一个Proteus制作元件的例子[原创]
- 单后东 on AT89S51 和 AT89S52的区别
Archives
- July 2010
- March 2010
- May 2009
- June 2007
- May 2007
- April 2007
- February 2007
- January 2007
- December 2006
- November 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- February 2005
Categories
Meta
Monthly Archives: July 2006
基于18B20的数字温度计
本设计采用2位数码管,数码管分别接到P0 和 P2口 18B20的DQ 接在 P.7 源程序如下,在Ay-MPU89S51学习板上调试成功。 (信息的兄弟们,谁用了这段代码给我留个言) /*************************************************************18B20驱动程序,DQ为数据口,接于P3.7*11.0592M晶振,上拉4.7k电阻*Author:fyb*2005-3-25 11:23,OK!*************************************************************/#include<reg51.h>#include<intrins.h> #define uchar unsigned char#define uint unsigned int sbit dq = 0xB7;bit flag;uint Temperature;uchar temp_buff[9]; //存储读取的字节,read scratchpad为9字节,read rom ID为8字节uchar id_buff[8];uchar *p;uchar crc_data;sfr DS1=0×80;sfr DS2=0xA0; unsigned char code DS2Code[]={0×03,0x9f,0×25,0x0d,0×99,0×49,0×41,0x1f,0×01,0×09,0×71,0xff};unsigned char code DS1Code[]={0xc0,0xF9,0xA4,0xB0,0×99,0×92,0×82,0xf8,0×80,0×90,0x9d,0xff};void … Continue reading
Posted in 从初学者到电子工程师
21 Comments