十字路口交通灯任务设计说明书_第1页
十字路口交通灯任务设计说明书_第2页
十字路口交通灯任务设计说明书_第3页
十字路口交通灯任务设计说明书_第4页
十字路口交通灯任务设计说明书_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

choose the correct meaning; (4) to correct the typos; (5) so the child write words (ABAB, and AABB); (6) in accordance with written words; (7) the complete word, and explain the meaning of the word; (8) collocation; (9) make sentences with the word; (10) the written language as required. (C) the main sentence types (1) complete sentences; (2) write down the meaning of a sentence or expression of thoughts and feelings; (3) write sentences as required; (4) finish malalignment of the sentence; (5) modified sentences. 2, knowledge classification (1) the common conjunctions coordinate: . . 一面 . 1, to examine the topic, identify problems associated with two 2, analysis, alternative question two is in direct proportion to the amount of the associated relationship is inversely proportional relationship. 3, and set unknown, column proportion type 4, and solutions proportion type 5, and test, wrote answer language plenary, and subject: application problem (1)-simple application problem and composite application problem review content simple application problem composite application problem answers application problem of general steps 1, and figure out meaning-through examines the, find known conditions and by seeking problem 2, and analysis number relationship-analysis known conditions Zhijian, and conditions and problem Zhijian of relationship, determine problem-solving method and problem-solving steps. 3, and column type calculation-lists formula, is out subdivisions 4, and test, and wrote answer-check, and checking, and wrote answers typical application problem 13, and subject: application problem (3)-column equation solutions application problem review content overview problem-solving steps 1, and figure out meaning, find by seeking of unknown and x said 2, and according to meaning find equivalent relationship, lists Equation 3, and solutions equation 4, and test, and wrote answers according to meaning find equivalent relationship of common method 1 , And according to common of number relationship type, established equivalent relationship 2, and according to has learn had of calculation formula, 3, and according to problem in the of focus described sentence from overall Shang determine basic of equivalent relationship 4, and using segment figure, and list method, method analysis number项目三 十字路口交通灯设计设计说明书任务一 交通灯灯控制一、任务设计要求1、基本要求十字路口交通灯以东西南北四个方向说明,当东西方向允许行车时,南北方向就会禁止车行,即此时的东西方向绿灯亮红灯灭,而南北方向的红灯亮绿灯灭;反正,当南北方向允许行车时,东西方向就会禁止车行,即此时的南北方向绿灯亮红灯灭,而东西方向的红灯亮绿灯灭。表1 十字路口交通信号灯控制要求方向状态状态1状态2状态3状态4东西方向信号绿灯亮黄灯闪烁红灯亮黄灯闪烁 时间5S间隔300ms闪烁3次维持1.8S5S间隔300ms闪烁3次维持1.8S南北方向 信号红灯亮黄灯闪烁绿灯亮黄灯闪烁 时间5S间隔300ms闪烁3次维持1.8S5S间隔300ms闪烁3次维持1.8S2、技能提高1、修改前面的程序,增加一个按钮,利用外部中断实现紧急情况时4个方向红灯均点亮。2、利用外部中断0实现紧急情况时4个方向黄灯间隔300ms闪烁5次,之后全部变为红灯。二、设计过程1、设计方案确定 电源 红黄绿灯发光时钟电路 AT89C51 并行 二极管显示复位电路 单片机 接口 按键2、 硬件电路设计3、软件设计(1)、绘制流程图(2) 、编写源程序:2个程序程序一:ORG 0000HLJMP START ORG 0003H ;外部中断INTO的中断入口 AJMP INT0S ;指向中断子程序 ORG 0040HMAIN: MOV IE,#81H ;1000 0101-允许INTO中断 EA=1 EX0=1 MOV TCON,#1 ;设置外部中断0为电平触发START: MOV P0, #03H ;送初始值 MOV P2, #0FFH ;送初始值 MOV R2, #03 ;延时300ms-3100ms LCALL DELAY ;延时M1: MOV P0, #0C3H ;1100 0011东西方向绿灯亮、南北方向红灯亮 MOV P2, #03H ; 黄灯灭 MOV R2, #50 ; 延时5s-50100ms LCALL DELAY ;延时 MOV R1, #03H ;闪烁次数设定3次 M2: MOV P0, #0CFH ;红绿灯灭 MOV P2, # 01H ;黄灯亮 MOV R2, #03 ;延时300ms-3100ms LCALL DELAY ;延时 MOV P0, #0CFH ;红绿灯灭 MOV P2, #03H ;黄灯灭 MOV R2, #03 ;延时300ms LCALL DELAY ;延时 DJNZ R1, M2 ;闪烁次数没到就继续 M3: MOV P0, #3CH ;0011 1100南北方向绿灯亮、东西方向红灯亮 MOV P2, #03H ; 黄灯灭 MOV R2, #50 ; 延时5s-50100ms LCALL DELAY ;延时 MOV R3, #03H ;闪烁次数设定3次 M4: MOV P0, #3FH ; 红绿灯灭 MOV P2, # 02H ;黄灯亮 MOV R2, #03 ;延时300ms-3100ms LCALL DELAY ;延时 MOV P0, #3FH ;红绿灯灭 MOV P2, #03H ;黄灯灭 MOV R2, #03 ;延时300ms LCALL DELAY ;延时 DJNZ R3, M4 ;闪烁次数没到就继续 SJMP M1 跳转M1INT: PUSH ACC ;中断现场 MOV R1,#05H ;送初始值M5: MOV P0,#0FFH ;红绿灯熄灭 MOV P2,#00H ;黄灯亮 MOV R2,#03 ;延时300ms LCALL DELAY ;延时 MOV P0,#0FFH ;红绿灯熄灭 MOV P2,#03H ;黄灯灭 MOV R2,#05 ;延时500ms LCALL DELAY DJNZ R1,M5 ;闪烁次数没到就继续 M6: MOV P0,#0FH ;红绿灯灭 MOV P2,#03H ;黄灯灭 POP ACC ;回复现场 RETI ;中断返回DELAY: MOV R3, #10 ;延时100ms D1: MOV R4, #20 ;延时10ms D2: MOV R5, #250 ;延时1msD3: DJNZ R5, D3 DJNZ R4, D2 DJNZ R3, D1 DJNZ R2, DELAY RET END程序二:4、 软、硬件调试仿真(效果图)任务二 数码管的中断嵌套一、任务设计要求1、基本要求利用数码管,使(P3.2)外接按钮,P0、P1、P2为输出口,接数码管,设置外部中断INT0为电平触发。要求:主程序P0口数码管循环显示08,INT0的中断服务程序控制P2口的数码管依次显示08。2、技能提高再使INT1(P3.3)外接按钮,让INT0、INT1同时存在,并设置INT1优先级高于INT0,设置两者均为电平触发,形成中断嵌套。要求:主程序P0口数码管循环显示08,INT0的中断服务程序控制P2口的数码管依次显示08,INT1的中断服务程序控制P1口的数码管依次显示08。二、设计过程1、设计方案确定2、 硬件电路设计3、软件设计(1)、绘制流程图(2) 、编写源程序:2个程序 ORG 0000H AJMP MAIN ORG 0003H ;外部中断INTO的中断入口 AJMP INT0S ORG 0013H ;外部中断INT1的中断入口 AJMP INT1S ORG 0030H ;MAIN: MOV IE,#85H ;1000 0101-允许INTO中断 EA=1 EX0=1 MOV TCON,#5 ;0000 0101-为边沿触发 MOV R1, #01H ;计数显示初始化 MOV DPTR,#TABDISP: MOV A, R1 MOVC A, A+DPTR ;查表的显示字型码 MOV P0, A ACALL DELAY ;调用延时1s INC R1 ;计数值加1 CJNE R1, #9,DISP ;秒值不到10,继续显示,否则清0 MOV R1, #01H SJMP DISPINT0S: PUSH ACC ;保护现场 PUSH DPH PUSH DPL PUSH PSW MOV R2, #01H ;计数显示初始化 MOV DPTR,#TABDISP1: MOV A, R2 MOVC A, A+DPTR ;查表的显示字型码 MOV P2, A ACALL DELAY ;调用延时1s INC R2 ;计数值加1 CJNE R2, #9,DISP1 ;秒值不到10,继续显示,否则清0 MOV P2 ,#0FFH POP PSW POP DPL POP DPH POP ACC ;恢复现场 RETI ;中断返回;INT1的中断服务程序INT1S: PUSH ACC ;保护现场 PUSH DPH PUSH DPL PUSH PSW MOV R2, #01H ;计数显示初始化 MOV DPTR,#TABDISP2: MOV A, R2 MOVC A, A+DPTR ;查表的显示字型码 MOV P1, A ACALL DELAY ;调用延时1s INC R2 ;计数值加1 CJNE R2, #9,DISP2 ;秒值不到10,继续显示,否则清0 MOV P1,#0FFH POP PSW POP DPL POP DPH POP ACC ;恢复现场 RETI ;中断返回TAB: ;0-9的显示字型码表 DB 0C0H,0F9H,0A4H,0B0H DB 99H,92H,82H,0F8H DB 80H,90H ;DB 88H,83H,0C6H,0A1H,86H,8EH ;0-F的显示字型

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论