1、the principle of simplified EIA of construction projects in the region. In terms of land, linked to the implementation of urban and rural construction land increase and decrease, replacement indicators for priority areas project. Charges, into the projects of water, electricity, administrative charg
2、es and preferential policies. In the area of taxation, and settled in areas of industry and its production company, within 5 years after the completion of fiscal incentives to enterprises. In terms of financing, integration of land, tax, financial and other resources, and construct Government credit
3、 + business credit credit system, establishment of marketization, commercialization and modernization of the investment and financing platform; effective Bank-enterprise docking, encourages private capital into the Park, to raise industry development fund. 5, optimize the environment and service ind
4、ustries. To create policy lowlands, Highlands, integrity of service land, development land as the goal, to optimize the area under development environment. All administrative law enforcement departments to appoint a full-time personnel stationed in areas dedicated to coordinating and solving problem
5、s associated with businesses in this sector. When there are substantial issues, sector leaders arranged to personally intervene, in-person, in-person push tangible area building a green light, easy line. To further reduce and standardize administrative examination and approval items, simplify examin
6、ation and approval links, improve efficiency; according to the .Since the educational practice of the mass line of the party, himself seriously in the education, practical control central eight rules and opposing the four winds and practicing three Suns, and check the spirit of Jiao Yulu, ideology,
7、solicit opinions based on outstanding problems checked swing, careful analysis and reflection. Will now check report is as follows: first, adherence to the partys political discipline, eight in the central provision, change the style of the basic situation of 1, in compliance with the partys politic
8、al disciplines. Conscientiously abide by the partys political discipline, abide by the Constitution and the rules and regulations of the party, in the political, ideological and maintain highly consistent with the CPC Central Committee on the action, there is no violation of the partys political dis
9、cipline problems. 2, in the implementation of the central authorities of the eight provisions. Improving research, improving research methods, but there are less grass-roots units, primary first-hand an inadequate grasp of the problem, which is to be strengthened in the future. Second, construction,
10、 strictly in accordance with the provisions to streamline and improve the quality of meetings of the Conference. Third, streamlining file briefs, culture involves all aspects of propaganda and ideology, sometimes due to the practical needs of invention notifications, this area needs further 西安建筑科技大学
11、课程设计(论文)一、课程设计(论文)题目十字路口交通灯模拟二、本次课程设计(论文)应达到的目的通过本次课程设计,使学生不仅更加深刻领会微型计算机从硬件组成到软件编程的基本原理和知识,而且更要学会应用,务必做到理论和实践相结合,掌握硬件分析、软件设计的基本思想和方法,提高分析问题、解决问题和工程实践的能力。 三、本次课程设计(论文)任务的主要内容和要求(包括原始数据、技术参数、设计要求等) 本课程设计题目的主要内容是模拟十字路口交通灯(红、黄、绿三色)的显示控制。设计要求为:1 主干道计时60秒,次干道计时45秒,时间到则切换红绿灯;2 红绿灯不变期间,在七段数码管上显示每秒倒计时;3 计时到最
12、后5秒时,两个方向的黄灯同时闪烁直至计时到0。四、应收集的资料及主要参考文献:1微型计算机基本原理与接口技术 陈红卫,科学出版社 2003.22.8086实验指导书 张维琪、张晓群,信控学院实验中心3.其他与本课程设计题目相关的资料五、审核批准意见教研室主任(签字) 摘 要本设计以TDN86/51实验箱为载体,结合中断控制器8259A、并行接口8255、中断定时器8253、七段数码显示管LED及八个发光二极管的功能,用汇编语言编程实现了十字路口交通灯模拟的实验。8255A的两个端口在本次实验中均有用处,A口为方式0用作输出,与七段数码管LED连接,用于向七段数码管输入数据的。B口为方式0用作输
13、出,与八个发光二极管连接,用于向发光二极管输入数据。C口低四位在本实验中做输出与LED数码管相连,高四位没有用到,但在初始化中将C口均初始化为输出。8253A芯片在本实验中用了计数器2工作在方式3下,计数初值赋为59500,工作箱的时钟频率为1.19MHz,即计时50ms,它的OUT2接到8259A的IRQ7上,让IRQ7每隔50ms发一次中断,这样就可以通过控制发中断的次数来得到想要的时间。8259A芯片在本实验中被用到了5个中断,作为计时或在特殊情况下的特殊功能。IRQ0是在遇到特殊情况,主干道一直保持通行(绿灯),次干道保持禁止通行(红灯)状态;LED显示SP表示STOP由按键KK1-控
14、制。IRQ2是在午夜车流量较少时,黄灯每隔0.5秒亮一次;LED显示LS表示LOW SPEED由按键KK2-控制。IRQ5是完成复位从45秒(即次干道通行)开始进入正常状态的由开关K0控制。IRQ6是完成复位从60秒(即主干道通行)开始进入正常状态的由开关K1控制。IRQ7是用于控制计时的。此交通等模拟系统具有以下功能:1. 装入程序运行后,先是主干道绿灯,次干道红灯,LED显示60-5秒的倒计时;其次主干道黄灯闪,次干道红灯仍然亮,LED显示5-0秒倒计时;再次主干道红灯,次干道绿灯,LED显示45-5秒倒计时;最后主干道仍然红灯次干道黄灯闪,LED显示5-0秒。这时一个周期结束,再次跳入进
15、入起始状态,再次循环一遍。2. 在上述正常状态中,特殊情况由8259A发中断。(1) 遇到特殊情况,主干道一直保持通行(绿灯),次干道保持禁止通行(红灯)状态;LED显示SP表示STOP,由按键KK1-控制。(2) 在午夜车流量较少时,可由按键KK2-发中断,黄灯每隔0.5秒闪一次,LED显示LS表示LOW SPEED。(3) 上述两种特殊情况结束后,可由开关K0完成复位从45秒开始进入正常状态;也可由开关K1完成复位从60秒开始进入正常状态。目录 摘要-3一题目要求及设计方案-5二方案设计-51.硬件连线图-62.软件流程图-7三实现程序-13四设计结果及分析-22五设计过程中出现的问题及解
16、决方案-23六心得体会-23七致谢-24八参考资料-24一 题目要求及方案分析1. 题目要求:设计题目的主要内容是模拟十字路口交通灯(红、黄、绿三色)的显示控制。并要求主干道计时60秒,次干道计时45秒,时间到则切换红绿灯;红绿灯不变期间,在七段数码管上显示每秒倒计时;计时到最后5秒时,两个方向的黄灯同时闪烁直至计时到0。2. 方案分析:本实验用到了8253A,8255A,8259A芯片,用8253A来计时,8255A的A、B口来做输出与七段数码管和发光二极管相连,8255A来发中断控制计时和特殊情况。二 方案设计 GATE2 CLK28253OUT2 OUT21. 硬件连线图: +5V 1.
17、19MHz系 IR7IR6IR58259 IR4 IR3 IR2IR1IR0 K1统 K0 kk2- kk1- PB7 l l PB08255 PA7 PC3 PC2 PC1 PC0 l PA0 PA0PB0 PB1 PB2 PB3总线LED X4 X3 X2 X1 h l l l aLED a a2. 软件流程图START主程序流程图 填写中断向量表8255A、8255A初始化开中断进入FANS1状态,主干道绿灯,次干道红灯。LED显示60-5秒倒计时进入FANS21和FANS22状态。两状态交替显示一秒,实现次干道一直红灯,主干道黄灯每隔一秒闪烁一次。LED显示5-0秒倒计时进入FANS3
18、状态,主干道红灯,次干道绿灯。LED显示45-5秒倒计时进入FANS41和FANS42状态。两状态交替显示一秒,实现主干道一直红灯,次干道黄灯每隔一秒闪烁一次。LED显示5-0秒倒计时调用显示子程序调用延时子程序子程序流程图:IRQ0:主干道一直保持通行(绿灯),次干道保持禁止通行(红灯)状态;LED显示SP表示STOP中断入口DI+1送5,DI送10,在LED上显示SP把0B7H送到B口,发光二极管显示黄灯调用显示子程序IRQ2:黄灯每隔0.5秒亮一次;LED显示LS表示LOW SPEED中断入口DI+1送11,DI送5,在LED上显示LS把0CCH送到B口,发光二极管显示黄灯调用显示子程序
19、count=10?NCount值赋为0 Y把0FFH送到B口,发光二极管灯都不亮调用显示子程序count=10?YNIRQ5:完成复位从45秒开始进入NORMAL状态中断入口开中断count值赋为08255A、8255A初始化 DI+1送4,DI送5跳入FANS3状态中断出口IRQ6:完成复位从60秒开始进入NORMAL状态中断入口中断出口跳入NORMAL状态DI+1送6,DI送0IRQ7:每隔50ms发一次中断,让COUNT值加1中断出口计数器count值加1中断入口显示子程序DISP PROC入口判断是否显示到最高位Y 把数据送到A口在LED上显示数据 N 调用延时子程序让下一位LED灯管
20、显示出口延时子程序DELAY PROC入口保护寄存器把CX赋值为2000CX=0?把CX值减1Y恢复寄存器 N出口三 实现程序STACK SEGMENT STACK DB 200 DUP(0)STACK ENDSDATA SEGMENTTIME DB 00H,06HLEDTAL DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,73H,38H COUNT DW 0DATA ENDSCODE SEGMENT ASSUME CS:CODE,DS:DATA,SS:STACKSTART:MOV AX,DATA MOV DS,AX ;填IR0中断向量 PUSH DS
21、MOV AX,0000H MOV DS,AX MOV AX,OFFSET IRQ0 ADD AX,2000H MOV SI,0020H MOV SI,AX MOV AX,0000H MOV SI,0022H MOV SI,AX CLI POP DS IN AL,21H AND AL,0FEH;清除对IRQ0的中断 OUT 21H,AL ;填IR2中断向量 PUSH DS MOV AX,0000H MOV DS,AX MOV AX,OFFSET IRQ2 ADD AX,2000H MOV SI,0028H MOV SI,AX MOV AX,0000H MOV SI,002AH MOV SI,AX
22、 CLI POP DS IN AL,21H AND AL,0FBH;清除对IRQ2的中断 OUT 21H,AL ;填IRQ5中断向量 PUSH DS MOV AX,0000H MOV DS,AX MOV AX,OFFSET IRQ5 ADD AX,2000H MOV SI,0034H MOV SI,AX MOV AX,0000H MOV SI,0036H MOV SI,AX CLI POP DS IN AL,21H AND AL,0DFH;清除对IRQ5的中断 OUT 21H,AL ;填IRQ6中断向量 PUSH DS MOV AX,0000H MOV DS,AX MOV AX,OFFSET
23、IRQ6 ADD AX,2000H MOV SI,0038H MOV SI,AX MOV AX,0000H MOV SI,003AH MOV SI,AX CLI POP DS IN AL,21H AND AL,0BFH;清除对IRQ6的中断 OUT 21H,AL;填IRQ7中断向量 PUSH DS MOV AX,0000H MOV DS,AX MOV AX,OFFSET IRQ7 ADD AX,2000H MOV SI,003CH MOV SI,AX MOV AX,0000H MOV SI,003EH MOV SI,AX CLI POP DS IN AL,21H AND AL,7FH;清除对I
24、RQ7的中断 OUT 21H,AL;NORMAL表示正常情况下的倒计时NORMAL:MOV AL,80H ;8255A初始化,A,B口方式0输出,C口输出 OUT 63H,AL MOV AL,0B6H ;8253A初始化,计数器2方式3 OUT 43H,AL MOV AX,59500 OUT 42H,AL MOV AL,AH OUT 42H,AL MOV COUNT,0 STI FANS1:MOV AL,0B7H ;FANS1表示主干道绿灯,次干道红灯。LED显示60-5秒 OUT 61H,AL CALL DISP CMP COUNT,20 JL FANS1 MOV COUNT,0 MOV D
25、I,OFFSET TIME MOV AL,DI+1 CMP AL,00H JZ A5 MOV AL,DI CMP AL,00H JZ A6 DEC AL MOV DI,AL JMP FANS1A5: MOV AL,DI CMP AL,06H JZ A0 DEC AL MOV DI,AL JMP FANS1A6: MOV AL,9 MOV DI,AL MOV AL,DI+1 DEC AL MOV DI+1,AL JMP FANS1A0: MOV AL,05H MOV DI,AL JMP FANS21;FANS21和FANS22表示次干道红灯,主干道隔一秒黄灯亮一次。LED显示5-1秒,再由1秒跳
26、为45秒FANS21:MOV AL,9DH ;FANS21表示主干道黄灯,次干道红灯 OUT 61H,AL CALL DISP CMP COUNT,20 JL FANS21 MOV COUNT,0 MOV DI,OFFSET TIME MOV AL,DI CMP AL,01H JZ A7 DEC AL MOV DI,AL JMP FANS22A7: MOV AL,4 MOV DI+1,AL MOV AL,5 MOV DI,AL JMP FANS3 FANS22:MOV AL,0BFH ;FANS22表示次干道红灯,主干道不亮灯 OUT 61H,AL CALL DISP CMP COUNT,20
27、 JL FANS22 MOV COUNT,0 MOV DI,OFFSET TIME MOV AL,DI CMP AL,01H JZ A7 DEC AL MOV DI,AL JMP FANS21FANS3:MOV AL,7BH ;FANS3表示主干道红灯,次干道绿灯。LED显示45-5秒 OUT 61H,AL CALL DISP CMP COUNT,20 JL FANS3 MOV COUNT,0 MOV DI,OFFSET TIME MOV AL,DI+1 CMP AL,00H JZ A8 MOV AL,DI CMP AL,00H JZ A9 DEC AL MOV DI,AL JMP FANS3
28、A8: MOV AL,DI CMP AL,06H JZ A1 DEC AL MOV DI,AL JMP FANS3A9: MOV AL,9 MOV DI,AL MOV AL,DI+1 DEC AL MOV DI+1,AL JMP FANS3A1: MOV AL,05H MOV DI,AL JMP FANS41;FANS41和FANS42表示主干道红灯,次干道隔一秒黄灯亮一次。LED显示5-1秒,再由1秒跳为60秒FANS41:MOV AL,6EH ;FANS41表示主干道红灯,次干道黄灯 OUT 61H,AL CALL DISP CMP COUNT,20 JL FANS41 MOV COUNT
29、,0 MOV DI,OFFSET TIME MOV AL,DI CMP AL,01H JZ A10 DEC AL MOV DI,AL JMP FANS42A10: MOV AL,6 MOV DI+1,AL MOV AL,0 MOV DI,AL JMP FANS1FANS42:MOV AL,7FH ;FANS41表示主干道红灯,次干道不亮灯 OUT 61H,AL CALL DISP CMP COUNT,20 JL FANS42 MOV COUNT,0 MOV DI,OFFSET TIME MOV AL,DI CMP AL,01H JZ A10 DEC AL MOV DI,AL JMP FANS4
30、1;以上执行完105秒为一个循环,再跳回FANS1重新开始循环;以下为遇到特殊情况的中断;IRQ0的中断服务程序IRQ0: MOV AL,20H ;遇到特殊情况,主干道一直保持通行(绿灯),次干道保持禁止通行(红灯)状态;LED显示SP表示STOP由按键KK1-控制 OUT 20H,ALL7: STI MOV DI,OFFSET TIME MOV AL,5 MOV DI+1,AL MOV AL,10 MOV DI,AL MOV AL,0B7H OUT 61H,AL CALL DISP JMP L7 IRET;IRQ2的中断服务程序IRQ2: MOV AL,20H ;在午夜车流量较少时,黄灯每隔
31、0.5秒亮一次;LED显示LS表示LOW SPEED由按键KK2-控制 OUT 20H,AL STI MOV DI,OFFSET TIME MOV AL,11 MOV DI+1,AL MOV AL,5 MOV DI,ALL3: MOV COUNT,0 L0: MOV AL,0CCH OUT 61H,AL CALL DISP CMP COUNT,10 JL L0 MOV COUNT,0L1: MOV AL,0FFH OUT 61H,AL CALL DISP CMP COUNT,10 JL L1 JMP L3 IRET;IRQ5的中断服务程序IRQ5: MOV AL,20H ;完成复位从45秒开始
32、进入NORMAL状态由开关K0控制 OUT 20H,AL MOV DI,OFFSET TIME MOV AL,4 MOV DI+1,AL MOV AL,5 MOV DI,AL MOV AL,88H ;8255A初始化,A,B口方式0输出,C低四位口输出,高四位输入 OUT 63H,AL MOV AL,0B6H ;8253A初始化,计数器2方式3 OUT 43H,AL MOV AX,59500 OUT 42H,AL MOV AL,AH OUT 42H,AL MOV COUNT,0 STI JMP FANS3 IRET;IRQ6的中断服务程序IRQ6: MOV AL,20H ;完成复位从60秒开始
33、进入NORMAL状态由开关K1控制 OUT 20H,AL MOV DI,OFFSET TIME MOV AL,6 MOV DI+1,AL MOV AL,0 MOV DI,AL JMP NORMAL IRET;IRQ7的中断服务程序IRQ7: INC COUNT ;由8253的OUT2控制,每隔50ms发一次中断,让COUNT值加1 MOV AL,20H OUT 20H,AL IRET;显示子程序DISP PROC NEAR MOV DI,OFFSET TIME MOV CL,0FEHST1: MOV AL,CL TEST AL,04H ;判断显示到第几位,是否显示到最高位 JZ ED OUT
34、62H,AL ;C口低四位做输入用于选择哪个LED亮 ROL AL,01H ;让下一位LED灯管显示 MOV CL,AL MOV AL,DI MOV BX,OFFSET LEDTAL XLAT OUT 60H,AL ;A口做输出用于LED显示 CALL DELAY INC DI JMP ST1ED: RET ;每个LED都显示完毕DISP ENDP;延时子程序DELAY PROC NEAR PUSH CX MOV CX,2000 ;0.5ms,每0.5ms就切换一次LED灯管的显示,给人视觉各个LED是同时亮WAIT: LOOP WAIT POP CX RETDELAY ENDPCODE ENDS END START 四 设计结果及分析装入程序运行后,程序进入正常状态。先是主干道绿灯,次干道红灯,LED显示60-5秒的倒计时;其次主干道黄灯每隔1秒亮一次,次干道红灯一直亮,LED显示5-0秒倒计时;再次主干道红灯,次干道绿灯,LED显示45-5秒倒计时;最后主干道一直保持红灯次干道黄灯每隔1秒亮一次,LED显示5-0秒倒计时。这时一个周期结束,再次跳入进入起始状态,重新循环一遍。在上述正常状态中,可由8259A发中断控制特殊情况,具体如下:1.遇到特殊
©2010-2025 宁波自信网络信息技术有限公司 版权所有
客服电话:4008-655-100 投诉/维权电话:4009-655-100