




已阅读5页,还剩10页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
romoting the construction of rule of law, but also the most basic development environment. Despite my good social order in General, but there are law-abiding consciousness, social order is not standard, regardless of faith, Twining visit visit and other outstanding problems. We want to actively promote the field of multi-level governance according to law, promote the continuous improvement of the social environment. To promote universal compliance. Actively foster the rule of law culture, carry out law publicity and education on honesty and trustworthiness, guide the masses and consciously abide by the law, failing to find method, problem-solving method, method of gradually changing the world, he is not looking for but someone unspoken rules, formed all law law, abide by the good atmosphere. To strengthen the comprehensive management of public security. Deepening peace xingan construction, strongly against violence crime, mafia and serious criminal offences, to protect the legitimate rights and interests of citizens, legal persons, carry out criminal policy of temper justice with mercy, the maximum stimulating social vitality, and earnestly safeguard social harmony and stability. To resolve social conflicts by law. To further smooth channels of reporting social conditions and public opinion, improving regulation, arbitration, as wellrelationship between Government and business. The two sessions, General Secretary of Pro, clear the word succinctly summarized the new relationship between Government and business, as pure politics, reshaping the political relationship specified in the direction. District leaders in handling political and business relations, engage in trading power for money, and finally stumbled, we a lesson, always keep in mind that Pro, clean practicing Pro, clear. Pro is to open a sincere engagement with private enterprise to help solve practical difficulties; Clear is to clarify the Division of power, exercised in accordance with, private entrepreneurs with innocent purity, not abusing power for personal gain, not to engage in trading power for money. Third, in order to maintain fairness and justice. Fairness and justice is the lifeline of the rule of law, is the best development environment. Currently, lax law enforcement and the judicial sector in our region also exist to varying degrees, law enforcement departments and individual window units power for personal gains and bribes, thick friends, relations, human cases, money cases in which seriously infringe on the legitimate rights and interests of enterprises and people. Especially some law enforcement and inspection for profit purposes, deliberately looking for corporate loopholes, found directly under the ticket does not give business improvement opportunities. We recruit a company doesnt easily, cultivating a business more difficult, never for personal gain, systematic harassment, card, last checked to check to get the enterprise collapsed. To guarantee the legitimate rights and interests. Always proceed from the overall situation of reform and development of services, fully consider the characteristics of production and management in non-public enterprises and social benefits, an accurate grasp of legal limits, protect the enthusiasm of entrepreneurs and practitioners in innovation and entrepreneurship, enhancing expectations and confidence. To promote strict enforcement. Strengthening law enforcement procedures, improve law enforcement performance evaluation, strengthening the supervision of law enforcement, exploration and practice of risk control mechanism of law enforcement to further standardize the social security, urban management, road traffic administrative law enforcement, effectively free, extensive law-enforcement and lax enforcement of law enforcement and other issues. To uphold justice. Justice is the last line of Defense to safeguard fairness and justice, to unequivocally support the courts and procuratorates independently exercise level . Judicial activities were rampant, must not be allowed to run, favors, money, must not be allowed to knowingly violate the miscarriage, violations of the legitimate rights and interests of the masses must not be allowed to abuse of power, to make forest mass can be felt in every judicial cases in equity and justice. Four to deepen grass-roots governance according to lawchain do long, and put scale big. To serve the development of enterprises. Duocuo simultaneously improving service efficiency, build better public services platform, enhance work efficiency, initiative to help businesses solve the project procedures, financing loans, issues such as land-use approval, reduce operating costs, business travel light and enhance the confidence to overcome all kinds of difficulties and the Foundation, real entrepreneurial passion play entrepreneurship, enhance the internal vitality and creativity. SI XING an construction, promoting the rule of law, tries to make the transformation of forest development XI General Secretary stressed, to reinvigorate Northeast China, optimized development environment is very important. Environment of rule of law most gather Moss, the most conducive to development. Improving the leading cadres using the method of thought and the rule of law Administration work, problem-solving, the ability to promote the development, is the key to promoting the rule of law. The law may affect the efficiency of out of the path of development will be more smooth, won development gains will be sustained, and end with greater efficiency. Leading cadres at all levels should take the lead in respect of law law, abide by, and actively foster Socialist culture, actively promoting the field of multi-level governance according to law, guide the masses and consciously abide by the law, failing to find law, solve the problem by law, in accordance with the law prevail. XXX administration by law of leading cadres do not exist on the rule of law, law enforcement, casual, and vow not to investors, the new scores and other turmoil. These important expositions on my district create good development environment with highly targeted and guidance, especially the General Secretary pointed out that the chaos in my area also exists to varying degrees, some even quite serious. Leading cadres at all levels must improve the development environment of rule of law as a fundamental task, adhere to the problem oriented, solid and solve the problems in the construction of rule of law, to rule the new effect for development environment improvements. To hold key minority. Leaders of this group, although few in number, but the effect is critical. If a local leaders take the lead right according to law, in accordance with the law, the local CPPCC fresh, pragmatic and efficient development environment. Conversely, if a local leaders of ignoring the law, impunity, not only the political environment will be destroyed, will have serious implications for the development environment. Now, some leading cadres lack of awareness on the importance of learning, that learn or not does not matter. Think efficiency is too low too much, act according to the procedure, than an executive order getting along with. In dealing with complex issues, often speak of settling and done; on the issue of handling letters and visits, like to spend money and buy stop and stable, but disregard the law administration, in accordance with the law, the rulechain do long, and put scale big. To serve the development of enterprises. Duocuo simultaneously improving service efficiency, build better public services platform, enhance work efficiency, initiative to help businesses solve the project procedures, financing loans, issues such as land-use approval, reduce operating costs, business travel light and enhance the confidence to overcome all kinds of difficulties and the Foundation, real entrepreneurial passion play entrepreneurship, enhance the internal vitality and creativity. SI XING an construction, promoting the rule of law, tries to make the transformation of forest development XI General Secretary stressed, to reinvigorate Northeast China, optimized development environment is very important. Environment of rule of law most gather Moss, the most conducive to development. Improving the leading cadres using the method of thought and the rule of law Administration work, problem-solving, the ability to promote the development, is the key to promoting the rule of law. The law may affect the efficiency of out of the path of development will be more smooth, won development gains will be sustained, and end with greater efficiency. Leading cadres at all levels should take the lead in respect of law law, abide by, and actively foster Socialist culture, actively promoting the field of multi-level governance according to law, guide the masses and consciously abide by the law, failing to find law, solve the problem by law, in accordance with the law prevail. XXX administration by law of leading cadres do not exist on the rule of law, law enforcement, casual, and vow not to investors, the new scores and other turmoil. These important expositions on my district create good development environment with highly targeted and guidance, especially the General Secretary pointed out that the chaos in my area also exists to varying degrees, some even quite serious. Leading cadres at all levels must improve the development environment of rule of law as a fundamental task, adhere to the problem oriented, solid and solve the problems in the construction of rule of law, to rule the new effect for development environment improvements. To hold key minority. Leaders of this group, although few in number, but the effect is critical. If a local leaders take the lead right according to law, in accordance with the law, the local CPPCC fresh, pragmatic and efficient development environment. Conversely, if a local leaders of ignoring the law, impunity, not only the political environment will be destroyed, will have serious implications for the development environment. Now, some leading cadres lack of awareness on the importance of learning, that learn or not does not matter. Think efficiency is too low too much, act according to the procedure, than an executive order getting along with. In dealing with complex issues, often speak of settling and done; on the issue of handling letters and visits, like to spend money and buy stop and stable, but disregard the law administration, in accordance with the law, the rule微控制技术课程设计论文引言本次课设主要是运用单片机及按键、数码管显示等常见外围电路知识,结合实际生活中电梯的运作,实现对三层电梯控制模型的设计。1 设计任务及要求 1.1 设计任务 三层电梯控制模型的设计。1.2 设计要求u 用户可通过按键发出请求;u 可实时显示电梯所在楼层;u 按键按下后,相应的LED灯亮;u 可对发出的服务请求进行合理的分析调度并作出正确的响应;u 用户请求得到服务后,可更新状态。2 设计方案及器件介绍 2.1 设计方案介绍 在工业上,多采用可编程控制器或微型计算机实现电梯逻辑控制,可编程控制器抗干扰性强,但针对性强、价格较贵,为实现电梯控制的模拟,本设计采用单片机为控制中心,针对所在的不同楼层分别进行合理的调度。设计中按键用于给用户发出服务请求,LED电路用于显示请求状态及电梯运行状态、数码管显示电路来显示实时楼层,而电梯上升或下降的过程则通过定时来模拟。2.2 主要器件介绍2.2.1 AT89S51单片机AT89S51是一个低功耗,高性能CMOS 8位单片机,片内含4k Bytes ISP(In-system programmable)的可反复擦写1000次的Flash只读程序存储器。(1)主要特性4K字节可编程FLASH存储器(寿命:1000写/擦循环) 全静态工作:0Hz-33MHz 三级程序存储器保密锁定 128*8位内部RAM 32条可编程I/O线 两个16位定时器/计数器 6个中断源 可编程串行通道 低功耗的闲置和掉电模式 片内振荡器和时钟电路(2)管脚介绍VCC:供电电压。 GND:接地。 P0:P0口为一个8位漏级开路双向I/O口,作为普通IO口使用需要外加上拉电阻P1:P1口是一个内部提供上拉电阻的8位双向I/O口,P1口缓冲器能接收输出4TTL门电流。P2:P2口为一个内部上拉电阻的8位双向I/O口,P2口缓冲器可接收,输出4个TTL门电流。P3:P3口管脚是8个带内部上拉电阻的双向I/O口,可接收输出4个TTL门电流。RST:复位输入。PSEN:外部程序存储器的选通信号。EA/VPP:当EA保持低电平时,访问外部程序存储器。XTAL1:反向振荡放大器的输入及内部时钟工作电路的输入。 XTAL2:来自反向振荡器的输出。3 系统设计3.1 系统框图本系统以单片机为核心,通过扫描键盘点亮相应的指示灯,数码管显示实时楼层,单片机通过扫描按键指示灯来读取请求,根据所在楼层的不同,进行不同的分析、调度,然后做出正确的响应,更新状态并在指示灯和数码管上显示出来。系统结构如图1所示:单片机控制系统P3、P1口接LE指示灯矩 阵键 盘P2接2*4键盘行、列LED指示 灯P0接数码管段选数码管图1系统框图3.2硬件电路设计3.2.1 AT89S51电路通过下载器电路下载程序进入单片机。由内部振荡电路(12M晶振)产生12MHz的频率供单片机使用。使用按键按下时电平的改变使单片机复位。图2 图3 图4(1)下载器电路 (2)内部振荡电路 (3)按键电位复位 (4) 单片机控制电路由单片机的P0口控制数码管的位码和按键,P1口控制ADC0809数据的读取,P2口控制数码管的段码,P3口控制ADC0809的工作状态。图4 单片机控制电路3.2.2 按键控制电路P2.0、P2.1接矩阵的行线,P2.2P2.5接列线。图5 矩阵键盘3.2.3 LED指示电路 图6 LED指示电路3.2.4 数码管显示电路图7数码管显示电路3.3 软件编程设计3.3.1 程序流程图 初始化(设定电梯初始状态和定时器初值)显示当前楼层now、扫描键盘now=1的请求分析程序now=1的请求分析程序now=1的请求分析程序电梯动?now=3?now=2?now=1?电梯动?电梯动?等待中断YYYYYNNN开始图8.主程序流程图中断产生重装初值,中断次数tn加1tn=20?tn=0,更新now值新的now为目标层或有可读取的请求NYN停下来,等待一会,熄灭相应的指示灯中断返回Y图9 中断服务程序流程图4 电路及软件调试4.1主要软件和仪器仪表数字万用表:电路检测Keil:程序编译器DXP:电路设计软件4.2 电路调试u 对课题要求做出分析,列出所需模块有单片机最小系统、指示灯模块、按键电路、数码管显示电路;u 划分好系统模块后,根据实际情况确定各个模块的实现方式,为各模块分配I/O口,由此确定系统的大概结构。本设计中,由于系统硬件较简单,直接用各个I/O口控制各个模块,而无需经地址译码。其中,P0口给数码管送段选码,P3.0-P3.3和P1口控制电梯内外指示灯,P2口接按键;u 根据实际情况,确定各个模块的实现方式,进而确定系统的详细参数。本系统中所需按键较多故采用矩阵键盘,P0口无内部上拉电阻,故应在外部加上,此外,为使数码管足够量,用一个三极管进行驱动。u 运用DXP软件绘制原理图、PCB图并手动布线。绘制原理图的过程中,要注意选择合适的元件封装。在进行布线时不但要考虑电路的稳定、安全,还要考虑其美观、以及调试的方便,布线过程中要细心以免造成断路或短路;u 打印PCB图、熨烫、腐蚀、打孔、焊接、检查线路,腐蚀电路板时应注意把握度,以免腐蚀过度,打孔、焊接、检查电路时应细心以保证电路板的质量。4.2.2 电路板调试u 对着PCB目测所印电路有无断点或短路点,若有则用电烙铁进行焊接,如果怀疑某点是断点或者短路点,则应用万用表的蜂鸣器测试电路,蜂鸣器响代表电路通,否则代表断开;u 用万用表的蜂鸣再测试所有线路,特别是地线和电源线,确保都为正常通路;u 连接电路,确保无误后,连接电源。u 对各个模块进行检测,首先单片机上电后,各个I/O口一般为高电平,可用万用表检测验证,此时指示灯、数码管所有段应全亮,可观察指示灯和数码管是否正常亮,若不够亮或不亮,可能是电流不够,可检测相关节点电压以分析原因并解决。另外,可烧入一简单的拉低所有I/O口电平的程序,看是否有相应的变化。u 烧入一简单的程序,拉低键盘行线电平,列线保持高电平,按下按键,用万用表检测按下后按键所在列线电平是否变低,若变低则正常,否则,不正常,应检测相关节点的电平,以分析故障原因并解决。4.2.3 软件设计及编程u 分析实际生活中的电梯运行情况,总结电梯运行规律及原则。电梯在扫描到请求后,到底是否立即响应、何时响应,总是遵循“顺路”的原则,若请求的运动方向与电梯现行方向相同且在该方向上继续运行即可响应该请求,则“顺路”响应。u 根据电梯运行过程、规律和原则,设计合理的调度算法以实现电梯控制系统的模拟。由于本设计中电梯的层数较少,问题得以简化,电梯动作的调度,采用分层设计的方法,即对电梯在1、2、3层分别设计一请求分析程序,若要电梯运动则开中断,只要电梯所在楼层未变,就一直在相应的分析程序内,同时,该分析程序内应包含有键盘扫描程序。u 确定程序的结构后,便可结合硬件电路用keil编写各个模块的子程序。其中,键盘扫描采用行扫描法,检测到有按键按下即扫描两行,根据按下后列信号的变化来确定按下的键,进而点亮相应的指示灯。对于数码管则可写一简单的程序,送0-F的段码,使其每个数字显示1s,来判断数码管显示是否正常。u 各个模块的程序分块调试无误后,可结合起来联调,对于程序执行出现的非理想状况,进行分析并判别可能的原因,进行验证、确认、改正。u 基本功能正常后,试看某些复杂情况(如同时多个按键按下)能否做出正确的响应,若不能,则据现象进行改进。4.2.4调试中出现的故障及排除方法u 最初上电后LED指示灯部分亮,用万用表检测线路,发现有断路,连接好后,情况无改善,发现亮的灯几乎都是红色的,而绿灯只有一个亮,故猜想橙色灯需要的电流可能较大,把其换成红色的之后,能正常发光,猜想得到验证。但绿色的灯始终只有一个亮,尝试着把不亮的绿灯换成红灯,灯能正常发光,故障排除。u 最初上电后数码管只有部分段亮,且亮度不够,说明电流不够大,且电路可能存在断路,用万用表排除线路问题后,发现数码管公共阴极与其他阳极的压差1V都不到,故把P0口的上拉电阻换成470欧的,亮度有所改善但变化不大,且数码管不是所有段都亮。经计算确定上拉电阻已合适且三极管工作正常,故推测锁存器74573可能有故障,其芯片以正常供以电压,测试中发现其输入输出之间的压差较大,且触碰到该芯片时数码管显示不稳定,最后去掉该芯片,将与数码管某段不亮的阳极连接的引脚接至相应的P0口引脚,该段被点亮,证明锁存器工作不正常,把其移除后将其底座的输入和输出脚一一短接后,数码管各段均被点亮且亮度足够。u 烧入按键扫描程序时,发现烧不进去,总提示芯片使能有误,反复检查、尝试后仍不能烧,与其他同学讨论后发现是芯片与所用的下载口电路不匹配,列元件清单时位考虑到这一点。u 调试按键扫描程序时,按下按键,相应的指示灯无反应,排除线路连通故障后,依旧无改善,用万用表测量按键两端的电平时发现,按键按下后电平仍有0.5V,为无效电平,说明上拉电阻太小,使电流较大,换大些的电阻后,按键按下,则电平变为有效的低电平。u 在进行程序整体联调时发现,多个按键按下时,有时能扫描到所有按下的键,有时不能,且响应了一个请求之后,即使仍有请求灯在亮着,也不再做任何响应,按键也没反应,就像“死机”了一样。推测可能按键扫描的频率不够高,或者逻辑上不全面,程序进入到一个死循环,故在程序中检查并完善了条件判断语句,几处添加按键检测,只要有键按下就进行行扫描,如此,按键几乎都能扫描到。u 电梯在一楼时若同时按下2、3数字键,电梯总是上到2楼不停,到3楼后才回到2楼,推测在到2楼时的判断分析程序有错。反复检查、修改无改善后,发觉原先把判断分析电梯怎么动作的程序都写在中断服务程序内,故只有电梯到了新的楼层才会得到下一步怎么走的命令,且在中断服务程序中无按键扫描,故刚好到达某一楼层时按下的键无法扫描到,电梯除初始态外,静止在其他楼层时若有按键按下未必能进行合理的分析和处理。总结以上不足后,把判断电梯该如何动作的分析调度程序改写到主程序中,各个楼层均有一个对应的分析程序,改分析程序内已包含键盘扫描程序,只要电梯未到达新的楼层就始终执行该分析程序。在分析过程中,发现要让电梯上升或下降时就开中断,在等待中断次数够20次(定时2s)的过程中仍未到达新的楼层,故期间一直在执行该分析程序。按照以上思路改进后,上述问题得到解决,故障得以排除。5 设计总结5.1 电路设计总结本系统的硬件结构简明、清晰,但在调试过程中还是发现很多的问题,分析这些问题后发现,电路设计、制作过程中需注意很多问题。首先,在划分系统模块、确定各模块实现的电路形式时,不但要考虑控制芯片的控制I/O口个数、特点,还应根据系统运行时的环境和具体情况来选择与之最合适的电路形式和元件;其次,在设计过程的每一步时,都应该考虑如何设置才能便于后续的工作及最终的调试和操作;此外,在确定各个模块的电路后,应对电路某些关键的参数进行分析,结合实际与理想的区别,进行合理的设置。5.2 软件设计总结本系统设计的关键和难点就是电梯动作的调度程序,正因如此,在设计和调试程序的过程中,获益匪浅。首先,在对设计所要模拟、实现的内容分析时,不但要全面考虑各种情况,而且,还要准确的把握这些不同情况的规律以及所遵循的统一原则,如本电梯控制模型设计中就应该考虑到不同情况下对相同请求的响应的差别、相同情况下对不同请求响应的区别,而且,要从中找出其“顺路”的请求先响应的原则、规律;其次,编写程序代码时,要养成良好的编程习惯,有好的设计风格,关键性语句加注释,使程序可读性强,也便于后续的查错、调试;再者,在写到条件、循环语句时,要考虑全面,以免逻辑错误或死循环;此外,对于用到的状态变量和控制变量,应进行初始化,以免默认的初始化值与预想的不一致。附 录 1以下为本次电路设计原理图附 录 附 录 2下为程序清单:include#include#define uint unsigned int#define uchar unsigned charuchar code table=0x3f,0x06,0x5b,0x4f;uchar num,temp,temp1,temp2,busy,rqst,flag,uf,df,ref,now,next,setf;uint tn;sbit start=P10 ;sbit F1=P11 ;sbit F2=P12 ;sbit F3=P13 ;sbit UPI=P14 ;sbit DNI=P15 ;sbit UPO=P16 ;sbit DNO=P17 ;sbit UP1=P30 ;sbit UP2=P31 ;sbit DN2=P32 ;sbit DN3=P33 ;void display(uchar now);void delay(uint z);uchar keyscan();void pause()main()busy=0; /初始化now=1;flag=1;num=0;P1=0x00; P3=0xf0;TMOD=0x01;TH0=0x3c;TL0=0xb0;EA=1;ET0=1;/开定时器0中断 while(1)display(now); /显示初始楼层if(P2!=0xfc) /有键按下则扫描 delay(15);if(P2!=0xfc)keyscan(); /1楼的分析程序 while(now=1) display(now);if(UP2=1 | F2=1 | F3=1) TR0=1; UPO=UPI=1; else if(DN3=1)TR0=1; UPO=UPI=1; else if(DN2=1)TR0=1; UPO=UPI=1; P2=0xfc;if(P2!=0xfc) delay(15); if(P2!=0xfc) keyscan(); /3楼的分析程序while(now=3) display(now); if(DN2=1 | F2=1 | F1=1) TR0=1; DNO=DNI=1; flag=0;else if(UP1=1)TR0=1; DNO=DNI=1; flag=0;else if(UP2=1)T
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 攀枝花市2025年医疗卫生辅助岗招募(70人)备考练习题库及答案解析
- 冠心病护理常规试题及答案
- 2025云南玉溪市江川区医共体招聘编制外人员9人备考练习试题及答案解析
- 2026南芯科技校园招聘考试参考试题及答案解析
- 2025版委托代付业务合作协议书
- 2025年荒山承包合同范本:林业产业扶贫合作
- 2025版牲畜养殖企业承包与市场推广合同
- 2025版艺术展览设计与策划年度服务合同
- 2025版退汇业务风险管理体系建设合同
- 2025年度外墙防水涂料行业标准制定与实施合同
- DL-T5588-2021电力系统视频监控系统设计规程
- DL-T5366-2014发电厂汽水管道应力计算技术规程
- 石材厂设备保养操作手册
- 金融理财基础知识
- 送别混声合唱简谱
- 全国食品安全风险监测参考值 2024年版
- 文昌顺发畜牧有限公司养猪场项目 环评报告
- 化学在材料科学中的应用
- 高中物理知识模型探究与实践-电磁学篇
- 四年级下册递等式计算练习400道及答案
- 2024年华能甘肃能源开发有限公司招聘笔试参考题库含答案解析
评论
0/150
提交评论