版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
目录第一章自动化工程训练设计的目的意义 11.1设计目的 11.2课程在教学计划中的地位和作用 1第二章空气湿度测量与报警系统软硬件设计任务 32.1设计内容及规定 32.2课程设计的规定 3第三章总体设计方案 53.1总体设计思想 53.2总体设计流程图 6第四章硬件设计 74.1硬件设计概要 74.1.1湿度采样电路 74.1.2驱动器接线 84.2所用到的芯片及其各自功能说明 84.2.1芯片列表 84.2.28032的功能简介 94.2.34.2.48279的功能简介 114.2.5LCD的功能简介 124.2.6湿度传感器 12第五章软件设计 145.1系统模块 145.2各模块介绍 14第六章系统调试及使用说明 186.1系统调试 186.2使用说明 18第七章收获、体会 19参考文献 20附录 21课程设计的目的、意义设计目的通过微控制器的硬件和软件的学习,使学生对单片机系统有一个全面、深刻的了解,可以纯熟掌握芯片的工作原理和使用方法,从硬件和软件两方面的基础上对所学知识进行应用,对在课程设计过程中碰到的问题进行相关解决并分析结果,使学生可以在实际应用的过程中掌握软、硬件应用的精华部分,可以进行相对独立的程序设计和硬件设计,本质上实现了《微控制器技术》课程的教学目的。本次设计重要可以完毕对空气湿度的测量监控和数据解决以及显示报警功能的实现,可以通过键盘输入参数来设立系统得目的值和报警值,通过LCD来显示当前相对湿度值和键盘输入的目的值、报警值。当当前相对湿度值达成某种限度时,作出相应得驱动和报警。1.2课程在教学计划中的地位和作用计算机是当今发展最快的领域,随着计算机技术的发展,与其遥相呼应的微控制器的发展也是惊天地泣鬼神,正是这种软、硬件的更新换代,对学生学习微控制器技术这门课程和掌握相关的硬件知识变得更加重要,做到学以致用,使所学习的知识有助于此后的工作和学习,有必要将课堂上学习的理论和实践的结合,使学生可以真正的独立完毕一项有一定知识架构的课程设计,如何自己思考相关的问题,如何去查资料并通过资料汇总得出相关结论,如何去学习新的东西,如何去了解我们生活中智能仪器的相关知识,以及在应用的过程中制定相应的问题的解决方案并通过不断实践来提高学生分析问题和解决问题的能力。由于单片机在平常生活中的可见性和普遍性,使得这次课程设计重要是以生活中常见的电子电器为参考作出设计,例如:空调系统,洗衣机系统,温度监控系统,湿度监控系统。这些在平常生活中使用十分普遍的电器,在课程设计中我们可以从原理上,从内在的运算结识到理论对实践的重要性以及实践来源于理论的意义。对一个系统成功的设计出来后的喜悦感让我们对微控制器的积极性充足的调动起来了。所以说在这个经世致用的中南大学和创新型社会下,课程设计是必不可少,更是重中之重,意义重大性是不可忽视的。空气湿度测量与报警系统软硬件设计任务设计内容及规定设计出具有A/D采样、键盘输入参数设立的空气湿度检测、解决、显示和报警,并且可在线键盘参数设立、定期检测、显示和喇叭与灯光报警的空气湿度测量与报警系统。课程设计的规定2.2.11).掌握单片微控制器硬件结构和工作原理、中断与定期系统等基本概念和原理;2).熟悉8/16位单片微控制器(8X51/196系列)的重要功能单元和指令系统;3).运用微控制器的接口技术进行简朴的测控及自动化应用系统设计;2.2.2课程设计的具体规定如下1)湿度采样由于湿度传感器的湿度检测转换并提供0-5V的信号输入,因此课程设计规定A/D多路采样电位器的输入电压,0-5V转换为00-0FFH数字信号,并存储计算显示.同时通过双通道采样同一个电位器的输入求平均值来保证采样的精度和显示值的稳定性.在此同时,增长第三通道独立采集,比较两种情况。2)报警解决键盘输入湿度的目的值和报警值,对采样进来的当前信号转换成数字信号后,与目的值和报警值做比较:(1)若当前值低与目的值,则属于干燥状态,亮绿灯灯;此时,应启动加湿器。(2)若当前值高于目的值同时低于报警值,则属于正常状态,亮黄灯;(3)若当前值高于报警值,则属于高湿度危险状态,两红灯,同时喇叭报警,并启动干燥器。(3)键盘输入和显示通过键盘输入的参数(目的值和报警值)同时进行显示,对当前采样值进行动态显示,并可在线修改参数。总体设计方案3.1总体设计思想总体设计思想分为以下六点:1)定义53H,63H,73H分别为目的值,报警值,当前值的存储区.一方面调用一次显示程序,静态显示”请同时输入目的值和报警值,按功能键拟定”,将输入的十进制值分别送到53H和63H,在P3.2有一个脉冲输入时,重新进入键盘扫描程序,否则完毕键盘输入功能,并可在线修改参数;2)通过AD转换将输入的电压信号转换为数字信号并调用数制转换程序,将16进制的当前值转换为十进制的三位数,同时存储在73H,完毕信号检测和数制转换功能;3)对转换后的当前值和输入的目的值,报警值做比较,运算后,根据不同的比较结果,改变,P1.1,P1.2,P1.3,P1.4,P1.5的状态,完毕比较功能;4)将当前采样值,键盘输入的目的值和报警值分别显示在LCD相应的位置上,完毕显示功能;5)根据3)中的改变情况,分别驱动红黄绿灯以及喇叭,P1.4,P1.5分别接干燥器和加湿的驱动器,完毕报警功能.6)作适当延时,在返回到AD转换阶段之前,判断P3.2的电位,若收到一脉冲,则此时开始重新初始化,进入键盘扫描程序,若没检测到,则继续采样重新扫描完毕定期检测功能.总体设计思想就为这样的不断循环,其中由于P1.4,P1.5的存在有一定的反馈控制,但是由于实验规定中并没作规定,因此,软件程序中对P1.4,P1.5的改变,以及硬件电路中对P1.4,P1.5的驱动接线并没有在实验室实现。3.2总体设计流程图程序流程图如图3.1开始开始初始化及初始显示扫描键盘,键盘输入程序启动AD双通道采样采样值转换采样值与设定值比较输出显示程序报警驱动解决程序需要修改参数?是否图3.1程序流程图硬件设计4.1硬件设计概要4.1.1:湿度采样电路:湿度采样电路用高分子湿度传感器CHR01为复合型电阻型湿度敏感部件,其复阻抗与空气相对湿度成指数关系,直流阻抗(普通数字万用表测量)几乎为无穷大,与传统意义上的电阻有空气中水分子参与膜感湿中的离子导电,由于水分子为极性分子,在直流电存在的情况下,会电离,分解,从而影响导电与元件的寿命,所以规定采用交流电路对传感器进行供电。湿度传感器由于其必须的激励通过交流电来实现,及不同温度特性下阻抗不同的特性,决定了其在AD采样电路中必须采用动态采样的方法,并同时采样温度信号。具体电路示意图4.1如下:图4.1湿度采样电路参数设计:R0采样电阻的阻值通常建议在30-50KΩ,侧重高湿测量,采样电阻阻值可减少到20KΩ,低湿阻值可提高到100KΩ。在信号的正周期内的中间段进行采样,直接通过度压法采集,注意采样时间,通过电压采样后得到V0,计算如下:RX=R0*(V-V0)/V0同时检测当前温度T,通过查阅湿度传感器Z/RH/T数据表,在不同温度下RX的值推算出当前的相对湿度RH%。不同单片机也许得到的数据会有所不同,可通过软件进行矫正。4.1.2P1.1接红灯P1.2接黄灯P1.3接绿灯P1.4可同时接喇叭和干燥驱动器P1.5接加湿驱动器所用到的芯片及其各自功能说明芯片列表(如表4.1)表4.1芯片列表芯片名称规格数量备注80321片八位单片机ADC08091片八位模数转换芯片74LS1641片74LS022片四2输入或非门82791片可编程键盘/显示接口LCD1片液晶显示器湿度传感器CHR011片8032的功能简介8031单片机采用40脚双列直插式封装结构,引脚配置如图4.3所示。图4.380C34.2.图4.4AD0809芯片图ADC0809是采样频率为8位的、以逐次逼近原理进行模—数转换的器件。其内部有一个8通道多路开关,它可以根据地址码锁存译码后的信号,只选通8个单断模拟输入信号中的一个进行A/D转换。
1.重要特性
1)8路8位A/D转换器,即分辨率8位。
2)具有转换起停控制端。
3)转换时间为100μs
4)单个+5V电源供电
5)模拟输入电压范围0~+5V,不需零点和满刻度校准。
6)工作温度范围为-40~+85摄氏度
7)低功耗,约15mW。2.内部结构
ADC0809是CMOS单片型逐次逼近式A/D转换器,内部结构如图13.22所示,它由8路模拟开关、地址锁存与译码器、比较器、8位开关树型D/A转换器、逐次逼近
3.外部特性(引脚功能)
ADC0809芯片有28条引脚,采用双列直插式封装,如图13.23所示。下面说明各引脚功能。
IN0~IN7:8路模拟量输入端。
2-1~2-8:8位数字量输出端。
ADDA、ADDB、ADDC:3位地址输入线,用于选通8路模拟输入中的一路ALE:地址锁存允许信号,输入,高电平有效。
START:A/D转换启动信号,输入,高电平有效。EOC:A/D转换结束信号,输出,当A/D转换结束时,此端输出一个高电平(转换期间一直为低电平)。OE:数据输出允许信号,输入,高电平有效。当A/D转换结束时,此端输入一个高电平,才干打开输出三态门,输出数字量。CLK:时钟脉冲输入端。规定期钟频率不高于640KHZ。
REF(+)、REF(-):基准电压。Vcc:电源,单一+5V。GND:地。ADC0809的工作过程是:一方面输入3位地址,并使ALE=1,将地址存入地址锁存器中。此地址经译码选通8路模拟输入之一到比较器。START上升沿将逐次逼近寄存器复位。下降沿启动A/D转换,之后EOC输出信号变低,指示转换正在进行。直到A/D转换完毕,EOC变为高电平,指示A/D转换结束,结果数据已存入锁存器,这个信号可用作中断申请。当OE输入高电平时,输出三态门打开,转换结果的数字量输出到数据总线上。4.2.48279的功能简介8279可按其功能分为:键盘功能块;显示功能块;控制功能块;与CPU接口功能块控制功能块涉及控制和定期寄存器,定期和控制,扫描计数器三部分,它重要用来控制键盘和显示功能块工作.控制和定期寄存器:用于存贮来自CPU的编程命令,CPU对8279编程以拟定键盘与显示器工作方式和其它工作条件时,先把命令控制数据放到数据总线上,然后使A0=1,WR=0CS=0,并在WR上升沿把命令键存在控制和定期寄存器中,并经译码,建立适当的功能.定期和控制:它含基本的定期计数器,第一个计数器是一个分频系数为2-31的前置定期器,分频系数可由程序预置,使内部频率为100KHz,从而能给出5.1ms键盘扫描时间和10.3ms反跳时间,其它计数器将此基本频率分频后,提供适当的按键扫描.行扫描.键盘阵列扫描.以及显示器扫描次数.扫描计数器:扫描计数器有两种工作方式,在编码工作方式时,计数器提供一种二进制计数,通过管脚SL0-SL3输出后经外部译码才干提供应键盘和显示器的扫描作用,在译码工作方式时,扫描计数器对最低二位进行译码,SL0-SL3输出4选1的译码信号,作为显示器和键盘的译码扫描.键盘功能块涉及:返回缓冲器,键盘反跳及控制,8x8FIFO传感器RAM,FIFO/传感器RAM状态.4.2.5图4.5LCD连线图4.2.6高分子湿度传感器CHR01、02系列为新一代复合型电阻型湿度敏感部件,其复阻抗与空气相对湿度成指数关系,直流阻抗(普通数字万用表测量)几乎为无穷大,与传统意义上的电阻有空气中水分子参与膜感湿中的离子导电,由于水分子为极性分子,在直流电存在的情况下,会电离,分解,从而影响导电与元件的寿命,所以规定采用交流电路对传感器进行供电。对湿度传感器而言,频率与阻抗之间存在一定的关系,对于测量30%--80%RH范围,频率的变化对传感器影响并不明显,在单片机软件编程的实际应用时,需要通过将传感器置于湿度发生装置中(例如恒温恒湿箱)进行实测,通过软件对最终的误差进行修正,此项修正基本上可以填补频率变化所产生的误差以及其他误差。湿度传感器阻抗变化与温度的关系见规格书中的数据表,先检测温度,然后按查表法对进行湿度检测。假如湿度精度规定不是特别严格的情况,(从数据解决简易的法则来说),可以推算湿度传感器温度系数为-0.4%RH/℃,公式为:H(t)=H(25℃例如,以实测阻抗按25℃的数据表读数,例如在35℃时读到的阻抗为30K,按最后的问题是在生产过程中,由于湿度传感器的因素或其他因素,总会碰到实际值与测量值之间存在误差的情况,在单片机功能允许的情况下,建议通过软件做最后的修正,重要采用跳线(JUMP)的方法对示值进行修正,安排一个IO,做加/减运算符号定义,其余2-4个IO,用于定义加/减的值,例如1,2,3,可以修正正负6%RH的示值偏差。软件设计5.1系统模块5.初始显示OUTPUT2键盘扫描及键盘输入INPUTAD采集ADSTART进制转换CONVER输入数据比较COMPARE采样输出OUTPUT报警以及相应控制CONTROL延时DELAY5.2模块介绍5.每个字的大小设立为16×16,因次可显示四行,每行显示8个字。第一行为“欢迎使用”;第二行为“请连续输入目的湿”;第三行为“度值和报警湿度值”;第四行不显示,为空白。5.2.28279键盘输入连续输入2组十进制数,第一组目的值,低于目的值则环境干燥,第二组为报警值,高于报警值则环境潮湿,在两数之间范围内适度正常。5.2由于0809是采样频率为8位的、以逐次逼近原理进行模—数转换的器件,所采集的数为00至FF,要转换为10进制时需要采集结果通过数制转换。需要采集结果与0.4相乘,此时出现较小误差。在出现余数时在对余数成0.4,至小数点后一位截至。子程序ADSTSRADSTAR:;AD转换LCALLDELAYMOVA,#00H;0通道MOVDPTR,#9000HMOVX@DPTR,ALCALLDELAYMOVXA,@DPTRLCALLDELAYMOVB,#02HDIVABMOV70H,AMOVA,#01H;1通道MOVDPTR,#9000HMOVX@DPTR,ALCALLDELAYMOVXA,@DPTRLCALLDELAYMOVB,#02HDIVABMOV71H,AMOVB,70HADDA,BMOV72H,A;取两者平均值MOVB,#5DIVABMOV79H,BMOVB,#2MULABMOV73H,A;100(64H)MOVA,79HMOVB,#4MULABMOVB,#10DIVABADDA,73H;100+1MOV73H,AMOV7AH,BMOVB,#100DIVABMOV74H,A;百位MOVA,BMOVB,#10DIVABMOV75H,A;十位MOVA,BMOV76H,A;个位MOVA,7AHMOV78H,ARET5.2.4COMPARE:MOVB,53H目的值储存区MOVA,#100CLRCSUBBA,BJNCCOMP1MOVA,#15HMOV50H,AMOVA,#22HMOV51H,AMOV52H,ACOMP1:MOVB,63H报警值储存区MOVA,#100CLRCSUBBA,BJNCCOMP2MOVA,#15HMOV60H,AMOVA,#22HMOV61H,AMOV62H,ACOMP2:MOVB,73H当前值储存区MOVA,#100CLRCSUBBA,BJNCCOMP3MOVA,#01HMOV74H,AMOVA,#0HMOV75H,AMOV76H,AMOV78H,ACOMP3:MOVB,53HMOVA,63HCLRCSUBBA,BJNCCOMP4MOVA,#15HMOV50H,AMOVA,#22HMOV51H,AMOV52H,ACOMP4:RET此子程序是用来检测输入格式是否对的,比如目的值不能超过报警值,而这都不能超过100,假如出现这几种情况,犯错的地方会有error显示在LCD上。5.2.5此输出就是把当前值实时显示出来,由于程序是进入的一个循环,AD不断的采样,这样数据实时更新。需要修改参数时只需至P3.2一个脉冲,程序跳转到8279初始化那,往下运营。5.2.6(1)若当前值低与目的值(下限),则属于干燥状态,亮绿(黄)灯灯;此时,应启动加湿器。(2)若当前值高于目的值(下限)同时低于报警值,则属于正常状态,亮黄(绿)灯;(3)若当前值高于报警值,则属于高湿度危险状态,两红灯,同时喇叭报警,并启动干燥器。系统调试及使用说明6.1系统调试通过三周的不断调试更改再调试,最终得到了完整的成功的一个湿度测量控制系统。在次过程中碰到了各种各样的问题,也采用了不同的解决方法。例如:根据规定的在线键盘输入,我们一开始将INPUT作为子程序放入循环中,结果出现每次循环都得进行一次键盘输入才可以继续下面的AD采样以及其他的显示报警子程序,显然这样不符合规定和不符合现实。通过讨论调试,修改为键盘输入放在主程序中,在开始初始化显示好进行一次键盘输入,然后通过P3.2的开关脉冲量的判断,若P3.2有一个脉冲输入,则跳到主程序最开始重新进行键盘输入,否则只进行AD采样转换显示和报警解决。我们最终完毕后出现一个问题,当AD0809采集通道什么都不接时,指示灯会红黄绿等一直不断地闪烁,开始我认为是自己开始并未给存储地址初始化,当我们给那个地址(43H)分别赋值为00H,0FFH时还会出现这种情况,最后在与老师的讨论中了解到,由于手拿接线来回摇摆时,会产生感应电压,是采集的数不稳定。使用说明1)运营程序进入系统监测状态后,LCD液晶显示“欢迎使用请连续输入湿度目的值和报警值(按F2确认并退出)”。2)通过键盘进行参数设立,例如输入050、080后按F2功能键确认。3)进行AD采样、转换、比较、显示、报警解决。LCD画面显示:湿度检测系统,当前湿度值为XX.XX%,目的值为50%,报警值为100%。XX.XX%为当前湿度相对值。并随湿度变化而改变。4)若XX.XX<50,则亮绿灯;50<XX.XX<100亮黄灯,XX.XX>100,亮红灯并喇叭报警。当当前值XX.XX改变时,以上解决状态跟随而变。5)需要参数重新设立,则给予开关P3.2一个脉冲(课程设计中以开关的一次1和一次0的给予),重新返回到1)步。收获、体会这次课程设计在周周内完毕一个系统的设计,时间还是比较富余的。在这段时间里,我解决很多在课堂上在老师那发现不了的问题,学习到了一个系统的成功不仅仅是需要会编程,更需要的是怎么样从一堆错误一堆问题中逐个排除,找到解决的办法。这一点我体会是十分深刻。例如:前面提到的键盘输入导致每次循环都得进行一次参数设立的问题,通过每一个子程序的单独运营,发现都可以正常运营,但融合到一起就出现问题了。单步运营,也没发现问题,一个一个子程序的屏蔽,找到了键盘输入的问题。于是解决办法就如前说产生出来了。此外,对于LCD显示,键盘输入和AD采样的模块组合,以及双通道采样保证精度也让我了解到,理论上的东西不通过实践自己是很难理解透的,“知道并不等于会用”这句话正是最佳的说明。参考文献[1]王秋爽曾昭龙.单片机开发基础与经典设计实例.北京:机械工业出版社,2023.1[2]林伸茂.8051单片机.北京:人民邮电出版社,2023.5附录(附源程序)源程序如下:ORG0100HMAIN:;主程序OUTPUT2:;初始静态显示MOVDPTR,#8000HMOVA,#00HMOVX@DPTR,A;写数据MOVA,#00HMOVX@DPTR,AINCDPTRMOVA,#42HMOVX@DPTR,A;写指令LCALLDY;设立图形显示起始地址MOVDPTR,#8000HMOVA,#10HMOVX@DPTR,AMOVA,#00HMOVX@DPTR,AINCDPTRMOVA,#43HMOVX@DPTR,ALCALLDYMOVA,#0A7H;设立图形显示范围MOVX@DPTR,ALCALLDYMOVA,#80HMOVX@DPTR,ALCALLDY;选择OR模式MOVA,#9BHMOVX@DPTR,ALCALLDY;文本关,图形开MOVDPTR,#8000HMOVA,#00HMOVX@DPTR,AMOVA,#00HMOVX@DPTR,AMOVA,#24HINCDPTRMOVX@DPTR,ALCALLDY;设立起始地址MOVA,#0B0HMOVX@DPTR,AMOVR0,#00H;开始数据自动写QSS0:;显示'欢迎使用'MOVA,R2MOVDPTR,#CHI5MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QSS0MOVR0,#00HMOVR2,#00HQSS1:;显示'请连续输入设立值MOVA,R2MOVDPTR,#CHI6MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QSS1MOVR0,#00HMOVR2,#00HQSS2:;显示'度值和报警湿度值'MOVA,R2MOVDPTR,#CHI7MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QSS2MOVR0,#00HMOVR2,#00HQSS3:;空白MOVA,R2MOVDPTR,#CHI8MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QSS3;取数据MOVDPTR,#8001HMOVA,#0B2HMOVX@DPTR,ALCALLDYINPUT:HA7S:MOVSP,#53H;初始化8279MOVDPTR,#0B001HMOVA,#00HMOVX@DPTR,AMOVA,#32HMOVX@DPTR,AMOVA,#0DFHMOVX@DPTR,AHA7S1:MOVXA,@DPTR;显示PJBACC.7,HA7S1MOVDPTR,#0B000HMOVA,#0C8HMOVX@DPTR,AINCDPTRMOVA,#80HMOVX@DPTR,AHA7S2:MOV30H,#80H;键扫程序MOV31H,#40HMOVR1,#50HHA7S3:MOVDPTR,#0B001H;数字键连续输入六位及显示MOVXA,@DPTRANLA,#07HCJNEA,#00H,HA7S4AJMPHA7S3HA7S4:MOVDPTR,#0B000HMOVXA,@DPTRMOVB,AMOVR3,#00HMOVDPTR,#KEYTABHA7S5:MOVA,#00HMOVCA,@A+DPTRCJNEA,B,HA7S6AJMPHA7SAHA7S6:INCDPTRINCR3MOVA,R3JBACC.4,HA7S3AJMPHA7S5HA7SA:MOVA,30HMOVDPTR,#0B001HMOVX@DPTR,AMOVA,R3MOV@R1,AMOVR0,31HMOV@R0,AINC31HMOVDPTR,#CDATAMOVCA,@A+DPTRMOVDPTR,#0B000HMOVX@DPTR,AINC30HINCR1CJNER1,#53H,CONMOVR1,#60HCON:MOVA,30HCJNEA,#86H,HA7SBLJMPJIAHA7SB:AJMPHA7S3JIA:MOVDPTR,#0B001H;功能键扫描MOVXA,@DPTRANLA,#07HCJNEA,#00H,JIA3AJMPJIAJIA3:MOVDPTR,#0B000HMOVXA,@DPTRMOVB,AHA7S7:MOVDPTR,#KEYTAB1HA7S8:MOVA,#00HMOVCA,@A+DPTRCJNEA,B,HA7S9AJMPKHA7S9:INCDPTRAJMPHA7S8K:LJMPLOOP0KEYTAB:DB0C1H,0C8H,0C9H,0D0H,0D8H,0E0H,0C2H,0CAH,0D1H,0D9HDB0DAH,0C3H,0CBH,0D2H,0D3H,0DBHKEYTAB1:DB0E3H,0E2H,0E1HCDATA:DB0CH,9FH,4AH,0BH,99H,29H,28H,8FH,08H,09H,88H,38HDB6CH,1AH,68H,0E8HLOOP0:MOV40H,#80H;清显示程序Q1:MOVA,40HMOVDPTR,#0B001HMOVX@DPTR,AMOVA,#0FFHMOVDPTR,#0B000HMOVX@DPTR,AINC40HMOVA,40HCJNEA,#86H,Q1AJMPMAIN1Q2:JBP3.2,Q3AJMPMAIN1Q3:LJMPINPUTMAIN1:LCALLADSTAR;启动AD转换LCALLCONVER;十进制转换LCALLCOMPARE;采样值与设立值做比较LCALLOUTPUT;采样值输出LCALLDELAY;延时LCALLDELAYLCALLDELAYLCALLDELAYLCALLDELAYCONTROL:MOVA,73H;根据比较结果作出判断MOVB,63HCLRCSUBBA,BLABA:SETBP1.0JCOKGETBAOJING:;红灯亮(高于报警值,处在危险状态)SETBP1.1CLRP1.2CLRP1.3SETBP1.4LCALLDELAYCLRP1.4LCALLDELAYLCALLDELAYDJNZ20H,LABAAJMPMAN1OKGET:MOVA,73HMOVB,53HCLRCSUBBA,BJCLOWERHIGHER:CLRP1.1SETBP1.2CLRP1.3;黄灯亮(高于目的值低于报警值)AJMPMAN1LOWER:CLRP1.1CLRP1.2;绿灯亮(低于目的值)SETBP1.3MAN1:MOVA,43HMOVB,63HCLRCSUBBA,BSETBP1.0JCOKBAOJIN:;红灯亮(高于报警值,处在危险状态)SETBP1.5CLRP1.6CLRP1.7AJMPMAN2OK:MOVA,43HMOVB,53HCLRCSUBBA,BJCQ4CLRP1.5SETBP1.6CLRP1.7;黄灯亮(高于目的值低于报警值)AJMPMAN2Q4:CLRP1.5CLRP1.6;绿灯亮(低于目的值)SETBP1.7MAN2:LJMPQ2COMPARE:MOVB,53HMOVA,#100CLRCSUBBA,BJNCCOMP1MOVA,#15HMOV50H,AMOVA,#22HMOV51H,AMOV52H,ACOMP1:MOVB,63HMOVA,#100CLRCSUBBA,BJNCCOMP2MOVA,#15HMOV60H,AMOVA,#22HMOV61H,AMOV62H,ACOMP2:MOVB,73HMOVA,#100CLRCSUBBA,BJNCCOMP3MOVA,#01HMOV74H,AMOVA,#0HMOV75H,AMOV76H,AMOV78H,ACOMP3:MOVB,53HMOVA,63HCLRCSUBBA,BJNCCOMP4MOVA,#15HMOV50H,AMOVA,#22HMOV51H,AMOV52H,ACOMP4:RETADSTAR:;AD开始转换LCALLDELAYMOVA,#00HMOVDPTR,#9000HMOVX@DPTR,ALCALLDELAYMOVXA,@DPTRLCALLDELAYMOVB,#02HDIVABMOV70H,AMOVA,#01HMOVDPTR,#9000HMOVX@DPTR,ALCALLDELAYMOVXA,@DPTRLCALLDELAYMOVB,#02HDIVABMOV71H,AMOVB,70HADDA,BMOV72H,A;平均值MOVB,#5DIVABMOV79H,BMOVB,#2MULABMOV73H,A;100(64H)MOVA,79HMOVB,#4MULABMOVB,#10DIVABADDA,73H;100+1MOV73H,AMOV7AH,BMOVB,#100DIVABMOV74H,A;百位MOVA,BMOVB,#10DIVABMOV75H,A;十位MOVA,BMOV76H,A;个位MOVA,7AHMOV78H,AMOVA,#02H多加通道,用来观测比较MOVDPTR,#9000HMOVX@DPTR,ALCALLDELAYMOVXA,@DPTRLCALLDELAYMOVB,#5DIVABMOVB,#2MULABMOV43H,ARETDELAY:MOVR6,#02HDELAY2:MOVR7,#0FFHDELAY1:DJNZR7,DELAY1DJNZR6,DELAY2RETCONVER:;做调整MOV53H,52HMOVA,51HMOVB,#10MULABADDA,53HMOV53H,AMOVA,50HMOVB,#100MULABADDA,53HMOV53H,AMOV63H,62HMOVA,61HMOVB,#10MULABADDA,63HMOV63H,AMOVA,60HMOVB,#100MULABADDA,63HMOV63H,ARETOUTPUT:;输出程序MOVDPTR,#8000HMOVA,#80HMOVX@DPTR,A;写数据MOVA,#00HMOVX@DPTR,AINCDPTRMOVA,#42HMOVX@DPTR,A;写指令LCALLDY;设立图形显示起始地址MOVDPTR,#8000HMOVA,#00HMOVX@DPTR,A;写数据MOVA,#00HMOVX@DPTR,AINCDPTRMOVA,#40HMOVX@DPTR,A;写指令LCALLDY;设立文本显示起始地址MOVDPTR,#8000HMOVA,#10HMOVX@DPTR,AMOVA,#00HMOVX@DPTR,AINCDPTRMOVA,#41HMOVX@DPTR,ALCALLDYMOVDPTR,#8000HMOVA,#10HMOVX@DPTR,AMOVA,#00HMOVX@DPTR,AINCDPTRMOVA,#43HMOVX@DPTR,ALCALLDY;设立图形显示范围MOVA,#0A7HMOVX@DPTR,ALCALLDYMOVA,#80HMOVX@DPTR,ALCALLDY;选择OR模式MOVA,#9CHMOVX@DPTR,ALCALLDY;文本开,图形开MOVDPTR,#8000HMOVA,#00HMOVX@DPTR,AMOVA,#00HMOVX@DPTR,AMOVA,#24HINCDPTRMOVX@DPTR,ALCALLDY;设立文本区指针MOVA,#0B0HMOVX@DPTR,AMOVR0,#00H;开始数据自动写MOVR0,#80HMOVDPTR,#8000HCLEART:CLRAMOVX@DPTR,ADJNZR0,CLEART;文本区清零MOVDPTR,#8000HMOVA,#00HMOVX@DPTR,AMOVA,#00HMOVX@DPTR,AMOVA,#24HINCDPTRMOVX@DPTR,ALCALLDY;设立起始地址MOVA,#0B0HMOVX@DPTR,A;开始数据自动写MOVR0,#57MOVR2,#0TEXT0:MOVA,#0MOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,TEXT0CLRCMOVA,#10HADDA,74H;湿度显示MOVX@DPTR,AMOVA,#10HADDA,75HMOVX@DPTR,AMOVA,#10HADDA,76HMOVX@DPTR,AMOVA,#0EH;;;;;;.....MOVX@DPTR,AMOVA,#10HADDA,78HMOVX@DPTR,AMOVR0,#28MOVR2,#0TEXT1:MOVA,#0HMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,TEXT1MOVA,#10HADDA,50H;目的湿度显示MOVX@DPTR,AMOVA,#10HADDA,51HMOVX@DPTR,AMOVA,#10HADDA,52HMOVX@DPTR,AMOVR0,#29MOVR2,#0T2:MOVA,#0HMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,T2MOVA,#10HADDA,60H;报警显示MOVX@DPTR,AMOVA,#10HADDA,61HMOVX@DPTR,AMOVA,#10HADDA,62HMOVX@DPTR,AMOVR0,#3MOVR2,#0T3:MOVA,#0HMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,T3MOVR0,#00HMOVR2,#00HQS1:MOVA,R2MOVDPTR,#CHI1MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QS1MOVR0,#00HMOVR2,#00HQS2:MOVA,R2MOVDPTR,#CHI2MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QS2MOVR0,#00HMOVR2,#00HQS3:MOVA,R2MOVDPTR,#CHI3MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QS3MOVR0,#00HMOVR2,#00HQS4:MOVA,R2MOVDPTR,#CHI4MOVCA,@A+DPTRMOVDPTR,#8000HMOVX@DPTR,AINCR2DJNZR0,QS4MOVDPTR,#8001HMOVA,#0B2HMOVX@DPTR,ALCALLDYRETDY:MOVR7,#01HDY1:MOVR2,#0FHDY11:DJNZR2,DY11DJNZR7,DY1RETORG2023HCHI1:;适度检测报警系统DB000H,000H,001H,000H,000H,000H,000H,000H,011H,0FCH,014H,040H,000H,07CH,010H,040HDB023H,0F8H,000H,080H,01FH,0F0H,01FH,0F8H,011H,004H,07FH,040H,03FH,080H,010H,020HDB012H,008H,03FH,0FEH,010H,010H,000H,000H,011H,004H,014H,07EH,002H,020H,023H,0FEHDB013H,0F8H,022H,020H,01FH,0F0H,000H,000H,0FDH,014H,07FH,048H,004H,020H,020H,040HDB082H,008H,022H,020H,010H,010H,000H,000H,011H,008H,061H,0A8H,008H,040H,044H,040HDB043H,0F8H,02FH,0FCH,01FH,0F0H,07FH,0FEH,015H,000H,0BDH,010H,01FH,080H,0F8H,088HDB050H,000H,022H,020H,004H,040H,001H,000H,019H,0FCH,025H,028H,003H,020H,009H,004HDB010H,0A0H,023H,0E0H,004H,040H,001H,000H,031H,084H,03DH,044H,00CH,010H,013H,0FEHDB010H,0A0H,020H,000H,044H,048H,011H,020H,0D1H,048H,002H,082H,03FH,0F8H,020H,094HDB024H,0A4H,027H,0F8H,024H,048H,011H,010H,011H,048H,0FFH,0FEH,010H,08CH,07CH,090HDB022H,0A8H,022H,010H,014H,050H,021H,008H,011H,030H,000H,000H,004H,0A0H,000H,090HDB0E2H,0B0H,021H,020H,014H,060H,041H,00CH,011H,010H,01FH,0F0H,008H,090H,000H,090HDB020H,0A0H,020H,0C0H,004H,040H,081H,004H,011H,038H,000H,000H,010H,088H,01DH,012HDB020H,0A0H,041H,030H,0FFH,0FEH,001H,000H,011H,04EH,01FH,0F0H,020H,084H,0E1H,012HDB02FH,0FEH,046H,00EH,000H,000H,005H,000H,051H,084H,010H,010H,042H,084H,002H,00EHDB020H,000H,098H,004H,000H,000H,002H,000H,021H,000H,01FH,0F0H,001H,000H,004H,000HCHI2:DB000H,000H,000H,000H,000H,000H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,020H,030H,000H,080H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,017H,0D0H,000H,0F0H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,004H,010H,01FH,040H,000H,000H,000H,000H,000H,000H,064H,000HDB000H,000H,000H,000H,005H,0D0H,012H,070H,000H,000H,000H,000H,000H,000H,064H,000HDB000H,000H,000H,000H,042H,020H,017H,0C0H,000H,000H,000H,000H,000H,000H,068H,000HDB000H,000H,000H,000H,023H,0E0H,012H,040H,000H,000H,000H,000H,000H,000H,068H,000HDB000H,000H,000H,000H,000H,040H,013H,080H,000H,000H,000H,000H,000H,000H,070H,000HDB000H,000H,000H,000H,011H,048H,010H,0C0H,030H,000H,000H,000H,000H,000H,016H,000HDB000H,000H,000H,000H,015H,050H,027H,040H,030H,000H,000H,000H,000H,000H,01AH,000HDB000H,000H,000H,000H,023H,060H,022H,040H,000H,000H,000H,000H,000H,000H,02AH,000HDB000H,000H,000H,000H,021H,040H,041H,080H,000H,000H,000H,000H,000H,000H,02AH,000HDB000H,000H,000H,000H,041H,0FCH,042H,060H,030H,000H,000H,000H,000H,000H,02AH,000HDB000H,000H,000H,000H,01EH,000H,09CH,03EH,030H,000H,000H,000H,000H,000H,044H,000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HCHI4:;报警湿度DB010H,000H,012H,040H,000H,000H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB010H,030H,01FH,058H,020H,030H,000H,080H,000H,000H,000H,000H,000H,000H,000H,000HDB011H,0D0H,034H,0E0H,017H,0D0H,000H,0F0H,000H,000H,000H,000H,000H,000H,000H,000HDB011H,010H,01EH,0A0H,004H,010H,01FH,040H,000H,000H,000H,000H,000H,000H,064H,000HDB01DH,060H,02AH,060H,005H,0D0H,012H,070H,000H,000H,000H,000H,000H,000H,064H,000HDB071H,000H,03AH,09CH,042H,020H,017H,0C0H,000H,000H,000H,000H,000H,000H,068H,000HDB015H,030H,007H,000H,023H,0E0H,012H,040H,000H,000H,000H,000H,000H,000H,068H,000HDB019H,0D0H,001H,0FCH,000H,040H,013H,080H,000H,000H,000H,000H,000H,000H,070H,000HDB031H,090H,07FH,000H,011H,048H,010H,0C0H,030H,000H,000H,000H,000H,000H,016H,000HDB0D1H,050H,000H,0C0H,015H,050H,027H,040H,030H,000H,000H,000H,000H,000H,01AH,000HDB011H,020H,007H,000H,023H,060H,022H,040H,000H,000H,000H,000H,000H,000H,02AH,000HDB011H,058H,000H,0C0H,021H,040H,041H,080H,000H,000H,000H,000H,000H,000H,02AH,000HDB031H,08EH,007H,040H,041H,0FCH,042H,060H,030H,000H,000H,000H,000H,000H,02AH,000HDB011H,000H,004H,040H,01EH,000H,09CH,03EH,030H,000H,000H,000H,000H,000H,044H,000HDB000H,000H,007H,080H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HCHI3:;目的湿度DB000H,000H,000H,000H,000H,000H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,0E0H,008H,000H,020H,030H,000H,080H,000H,000H,000H,000H,000H,000H,000H,000HDB00FH,020H,008H,038H,017H,0D0H,000H,0F0H,000H,000H,000H,000H,000H,000H,000H,000HDB008H,020H,008H,0C0H,004H,010H,01FH,040H,000H,000H,000H,000H,000H,000H,064H,000HDB008H,020H,00EH,000H,005H,0D0H,012H,070H,000H,000H,000H,000H,000H,000H,064H,000HDB00FH,020H,078H,01EH,042H,020H,017H,0C0H,000H,000H,000H,000H,000H,000H,068H,000HDB008H,020H,00BH,0E0H,023H,0E0H,012H,040H,000H,000H,000H,000H,000H,000H,068H,000HDB00FH,020H,018H,020H,000H,040H,013H,080H,000H,000H,000H,000H,000H,000H,070H,000HDB008H,020H,02CH,020H,011H,048H,010H,0C0H,030H,000H,000H,000H,000H,000H,016H,000HDB008H,020H,049H,028H,015H,050H,027H,040H,030H,000H,000H,000H,000H,000H,01AH,000HDB00FH,0A0H,089H,026H,023H,060H,022H,040H,000H,000H,000H,000H,000H,000H,02AH,000HDB008H,060H,00AH,022H,021H,040H,041H,080H,000H,000H,000H,000H,000H,000H,02AH,000HDB008H,020H,008H,0A0H,041H,0FCH,042H,060H,030H,000H,000H,000H,000H,000H,02AH,000HDB000H,000H,008H,040H,01EH,000H,09CH,03EH,030H,000H,000H,000H,000H,000H,044H,000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HCHI5:;欢迎使用DB000H,000H,000H,000H,000H,080H,040H,000H,008H,040H,000H,000H,000H,000H,000H,000HDB000H,000H,000H,000H,000H,080H,021H,080H,00CH,040H,01FH,0FCH,000H,000H,000H,000HDB000H,000H,000H,000H,0FCH,080H,036H,07CH,01BH,0FEH,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,005H,0FEH,024H,044H,010H,040H,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,085H,004H,004H,044H,037H,0FCH,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,04AH,048H,004H,044H,064H,044H,01FH,0FCH,000H,000H,000H,000HDB000H,000H,000H,000H,028H,040H,0E4H,044H,0A4H,044H,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,010H,040H,024H,044H,027H,0FCH,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,018H,040H,025H,044H,024H,044H,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,018H,060H,026H,054H,022H,040H,01FH,0FCH,000H,000H,000H,000HDB000H,000H,000H,000H,024H,0A0H,024H,048H,021H,080H,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,024H,090H,020H,040H,020H,080H,010H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,041H,018H,020H,040H,021H,070H,020H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,086H,00EH,050H,00FH,022H,01EH,020H,084H,000H,000H,000H,000HDB000H,000H,000H,000H,038H,004H,08FH,0FEH,02CH,004H,040H,094H,000H,000H,000H,000HDB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,088H,000H,000H,000H,000HCHI6:;显示'请连续输入设立值DB000H,040H,000H,000H,000H,010H,020H,040H,00CH,000H,000H,000H,010H,000H,000H,000HDB047H,0FCH,07FH,0FCH,000H,010H,020H,040H,006H,000H,01FH,0F8H,011H,0FCH,023H,0F8HDB030H,040H,040H,004H,07CH,010H,0FCH,0A0H,002H,000H,010H,008H,010H,000H,012H,008HDB023H,0F8H,040H,004H,044H,010H,021H,018H,001H,000H,010H,008H,010H,000H,013H,0F8HDB000H,040H,05FH,0F4H,047H,0FEH,043H,0F6H,003H,000H,010H,008H,0FCH,000H,082H,008HDB007H,0FEH,040H,004H,044H,010H,054H,000H,002H,080H,01FH,0F8H,013H,0FEH,043H,0F8HDB0F0H,000H,040H,004H,07CH,010H,0FCH,004H,002H,080H,010H,008H,038H,020H,050H,000HDB013H,0F8H,04FH,0E4H,045H,010H,053H,0D4H,004H,040H,010H,008H,034H,020H,010H,0A0HDB012H,008H,048H,024H,044H,090H,012H,054H,004H,020H,010H,008H,055H,028H,010H,0A0HDB013H,0F8H,048H,024H,044H,090H,01FH,0D4H,008H,020H,01FH,0F8H,051H,024H,024H,0A4HDB012H,008H,048H,024H,07CH,010H,0F2H,054H,008H,010H,010H,008H,092H,026H,022H,0A8HDB013H,0F8H,04FH,0E4H,000H,010H,013H,0D4H,010H,008H,010H,008H,014H,022H,0E2H,0B0HDB016H,008H,048H,024H,000H,010H,012H,054H,020H,00EH,010H,008H,010H,022H,020H,0A0HDB01AH,008H,040H,004H,000H,010H,012H,054H,040H,004H,01FH,0F8H,010H,020H,020H,0A0HDB012H,028H,040H,014H,000H,050H,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 员工出差协议
- 污水处理厂PE管道安装合同
- 滨水区域物业招投标策略
- 办公空间声学装修合同范本
- 电商运营专员聘用合同格式
- 医疗设备租赁合同协议书
- 健康承诺书:关注员工身心健康
- 房地产项目招标质疑处理指南
- 临时质量总监招聘协议
- 化妆学校餐饮服务人员劳动合同
- 中小学课外辅导机构创业计划书
- 群落的结构++第1课时++群落的物种组成课件 高二上学期生物人教版(2019)选择性必修2
- 临床决策分析课件
- 外科学(1)智慧树知到答案章节测试2023年温州医科大学
- DBJ15302023年广东省铝合金门窗工程设计、施工及验收规范
- 儿童口腔医学课件 乳牙活髓切断术及预成冠修复术
- 风险加权资产
- 涉及人血液、尿液标本采集知情同意书模板
- GB/T 9797-2022金属及其他无机覆盖层镍、镍+铬、铜+镍和铜+镍+铬电镀层
- JJF 1183-2007温度变送器校准规范
- 针刺伤专项测试卷含答案
评论
0/150
提交评论