51单片机与DS18B20测温的C程序——.doc
《51单片机与DS18B20测温的C程序——.doc》由会员分享,可在线阅读,更多相关《51单片机与DS18B20测温的C程序——.doc(5页珍藏版)》请在咨信网上搜索。
Delegates, staff: Hello! in the run-up to the Spring Festival, we held one session of four staff representatives Conference 2013-workshop, full back in 2012, careful analysis of the current situation, discuss 2013 development plans. Here, on behalf of my company 2013 work reports to the General Assembly, for consideration. Pillar I, 2012 back in 2012, XX power companies adhere to the party's 17 great spirit for guidance, comprehensively implement the scientific concept of development, promoting cost-leadership strategy, standards, focus on implementation, lean management, continuously improve, smooth present safety situation of enterprise management, business management and control scientific and standardized, and the dedication of staff, manage a harmonious and democratic atmosphere of the good situation. Main indicators are as follows:-the battery indicator: power generation totaled 7.815 billion kWh, beyond the annual budget implementation capacity of 315 million kWh, an increase of 757 million kWh. Sales totaled 7.425 billion kWh, exceeding sales of 330 million kWh the annual Executive budget, an increase of 729 million kWh. --Security measures: unplanned outages 2.5 times. No personal injury accident occurred, no major accident and above, no major fire accidents without environmental pollution accidents, safety for three consecutive years to maintain stability to good posture. – Business financial indicators: total profits of 255 million Yuan, beyond the annual budget of 207 million Yuan, beyond the Datang company index 41.89 million Yuan, an increase of 1.76 million Yuan, FCM assessment at grade four. --Energy: power supply standard coal completing 312.25 g/kWh, down 0.1 g/kWh; integrated auxiliary power consumption ratio in 5.12%, down 0.26%; pollutant emissions performance greatly reduced compared to last year, carbon 0.09 g/kWh, sulfur dioxide 0.104 g/kWh NOx 0.512 g/kWh; dust removal efficiency of more than 99.8%. --Reliability index: equivalent availability factor in 93.47%, increased 7.95% from a year earlier. Equivalent forced outage rate 0.08%, 0.16% reduction over the same period a year earlier. Major achievements: first, we should adhere to the two "management system" basis, strengthening technological research, strengthen hidden hazards control and intrinsic safety Enterprise construction took new steps. -The two "management system" for improvement. Focus on promoting the power of the company management system and the application and implementation of the safety loop five-star management system, improve the safety management system, realize the system of safety control. Further regulate security routines, safety supervision and management network role to play to achieve closed-loop. Strengthening the supervision and management of habitual violation of, strengthening the safety supervision of outsourcing contractors. Carried out in spring and autumn of security inspections, flood control and inspection, safety production month, day supervision of production safety and the Olympic Games and other /*----------------------------------------------- 名称:18B20温度传感器 日期:2012.8.25 修改:无 内容:18B20单线温度检测的应用样例程序,请将18b20插紧, 然后在数码管可以显示XX.XC,C表示摄氏度,如显示25.3C表示当前温度25.3度 ------------------------------------------------*/ #include<reg52.h> //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义 #include<math.h> #include<INTRINS.H> #define uchar unsigned char #define uint unsigned int /******************************************************************/ /* 定义端口 */ /******************************************************************/ sbit seg1=P2^0; sbit seg2=P2^1; sbit seg3=P2^2; sbit DQ=P1^3;//ds18b20 端口 sfr dataled=0x80;//显示数据端口 /******************************************************************/ /* 全局变量 */ /******************************************************************/ uint temp; uchar flag_get,count,num,minute,second; uchar code tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; //7段数码管段码表共阳 uchar str[6]; /******************************************************************/ /* 函数声明 */ /******************************************************************/ void delay1(uchar MS); unsigned int ReadTemperature(void); void Init_DS18B20(void); unsigned char ReadOneChar(void); void WriteOneChar(unsigned char dat); void delay(unsigned int i); /******************************************************************/ /* 主函数 */ /******************************************************************/ main() { unsigned char TempH,TempL; TMOD|=0x01;//定时器设置 TH0=0xef; TL0=0xf0; IE=0x82; TR0=1; P2=0x00; count=0; while(1) { str[5]=0x39; //显示C符号 str[1]=tab[TempH/100]; //十位温度 str[2]=tab[(TempH%100)/10]; //十位温度 str[3]=tab[(TempH%100)%10]|0x80; //个位温度,带小数点 str[4]=tab[TempL]; if(flag_get==1) //定时读取当前温度 { temp=ReadTemperature(); if(temp&0x8000) { str[0]=0x40;//负号标志 temp=~temp; // 取反加1 temp +=1; } else str[0]=0; TempH=temp>>4; TempL=temp&0x0F; TempL=TempL*6/10;//小数近似处理 flag_get=0; } } } /******************************************************************/ /* 定时器中断 */ /******************************************************************/ void tim(void) interrupt 1 using 1//中断,用于数码管扫描和温度检测间隔 { TH0=0xef;//定时器重装值 TL0=0xf0; num++; if (num==50) {num=0; flag_get=1;//标志位有效 second++; if(second>=60) {second=0; minute++; } } count++; if(count==1) {P2=0; dataled=str[0];}//数码管扫描 if(count==2) {P2=1; dataled=str[1];} if(count==3) { P2=2; dataled=str[2]; } if(count==4) { P2=3; dataled=str[3]; } if(count==5) { P2=4; dataled=str[4]; } if(count==6) { P2=5; dataled=str[5]; count=0;} } /******************************************************************/ /* 延时函数 */ /******************************************************************/ void delay(unsigned int i)//延时函数 { while(i--); } /******************************************************************/ /* 初始化 */ /******************************************************************/ void Init_DS18B20(void) { unsigned char x=0; DQ = 1; //DQ复位 delay(8); //稍做延时 DQ = 0; //单片机将DQ拉低 delay(80); //精确延时 大于 480us DQ = 1; //拉高总线 delay(10); x=DQ; //稍做延时后 如果x=0则初始化成功 x=1则初始化失败 delay(5); } /******************************************************************/ /* 读一个字节 */ /******************************************************************/ unsigned char ReadOneChar(void) { unsigned char i=0; unsigned char dat = 0; for (i=8;i>0;i--) { DQ = 0; // 给脉冲信号 dat>>=1; DQ = 1; // 给脉冲信号 if(DQ) dat|=0x80; delay(5); } return(dat); } /******************************************************************/ /* 写一个字节 */ /******************************************************************/ void WriteOneChar(unsigned char dat) { unsigned char i=0; for (i=8; i>0; i--) { DQ = 0; DQ = dat&0x01; delay(5); DQ = 1; dat>>=1; } delay(5); } /******************************************************************/ /* 读取温度 */ /******************************************************************/ unsigned int ReadTemperature(void) { unsigned char a=0; unsigned int b=0; unsigned int t=0; Init_DS18B20(); WriteOneChar(0xCC); // 跳过读序号列号的操作 WriteOneChar(0x44); // 启动温度转换 delay(200); Init_DS18B20(); WriteOneChar(0xCC); //跳过读序号列号的操作 WriteOneChar(0xBE); //读取温度寄存器等(共可读9个寄存器) 前两个就是温度 a=ReadOneChar(); //低位 b=ReadOneChar(); //高位 b<<=8; t=a+b; return(t); } 为确保工程节能保温,该工程窗选用了未增塑聚氯乙烯(PVC-U)塑料窗,有效的降低了通过窗造成能量损失,为了使能量损失达到最小,外门、窗框与墙体之间的缝隙采用硬泡聚氨酯发泡剂,聚氯乙烯泡沫塑料等软质材料堵封activities, comprehensive and tamping Safety Foundation ... Troubleshooting, management mechanism, give full play to role of technical supervision and realization of troubleshooting, management, improved process management. This year completed the boiler lower header leakage, boiler pressure, a major risk management, completed 29 of great risks and 3 General problems of governance. Complete chemistry lab construction, thermal control, and complete the boiler scale integrated management, host shafting vibration of 10 scientific and technological projects, such as. Complete supercritical 630MW on-line simulation system development and application of circulating water MCC standby power transformation, the transformation of desulfurization waste water, the unit water supply system of comprehensive treatment and discharge valve modification of coal mill 5 key technological transformation projects, group health is improved. --Science and technology innovation is further increased. Strengthen the characteristics of supercritical unit major issues, gradually clearing the particularity of supercritical unit and regularity. Developed motor oil time management, switch action times, statistics, coal-aided measurement software, improves the production level of lean management. Increased investment in science and technology, reporting science and technology projects and 14 technical project total cost percentage of the total annual production output of 0.25%. "Large-scale coal-fired power plant flue gas desulfurization, denitrification complete development and application of key technologies" project, won the national science and technology progress second prize. 630MW supercritical units optimized control strategies and the 630MW development and application of on-line simulation system for supercritical units, supercritical 600MW units of turbine driven boiler feed pump set of comprehensive treatment of defects Datang technology respectively one or two and third. Meanwhile, information technology achievements, the company was named "China power information technology benchmarking enterprises." --Repair and maintenance has improved further. Modify the inspection standards and standards on a regular basis, standardizing work procedures, checking and inspection project. Deepening the BFS++ system, and implements maintenance information shared. Reorganizing RB logic again, and ensure the success of the RB. Innovating the mechanism of maintenance management, implemented a project manager system. Successful completion of two autonomous maintenance, reliability improved steadily. Implementing two c-level maintenance, project themselves 48.7% and 42.3%, respectively. Accomplish two circulating pumps repair and overhaul of four Mills, maintenance teams to get exercise. Promote the work of energy saving and consumption reducing, complete the unit energy consumption diagnosis, plant water balance test, 10 energy-saving projects. Second, we should adhere to "three" on the economic benefits of improving, outreach- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 51 单片机 DS18B20 测温 程序
咨信网温馨提示:
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。
关于本文