资源描述:
《微机原理及接口技术word格式》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
南京工程学院课程设计任务书课程名称微机原理及接口技术院(系、部、中心)通信工程学院专业电子信息工程班级电信091学生姓名张浩学号指导教师宗慧 交通灯课程设计一.课程设计应达到的目的在学习《微机原理及接口技术》课程的基础上,进一步深入理解以8086为代表的通用微机的结构、工作原理和应用技术,提高微机控制系统的设计、研发能力;按照教学计划的要求,利用一周时间,综合应用所学知识,设计具有一定功能的小型微机测控系统,培养学生一定的自学能力和独立分析问题、解决问题的能力,要求学生能通过独立思考、查阅工具书、参考文献,提出自己的设计方案,找出设计中遇到问题的解决途径。二.课程设计题目及要求l题目:带时间显示的十字路口交通信号灯模拟控制系统设计1.利用STARES598PCI实验仪的硬件资源设计一个“带时间显示的十字路口交通信号灯模拟控制系统”。输入的所有控制信号通过实验仪上的状态开关模拟,东西、南北方向的红绿黄灯采用实验仪上的LED发光二级管模拟,东西、南北方向的信号灯变化,通行倒计时时间用数码管显示。2.功能描述:当东西方向(A道)和南北方向(B道)均有车辆要求通过时,A道和B道轮流放行。A道放行7S,B道放行5S,依次轮流。绿灯转换红灯时黄灯亮1S。一道有车,另一道无车时(用开关K5、K6状态模拟),控制系统能立即让有车道放行。遇有紧急车辆要求通过时(用开关K7状态模拟),系统能禁止普通车辆通过(A道、B道均为红灯),同时代表“紧急车辆通过”的另一个红灯闪烁。3.基本任务为必做项目,附加任务为选做项目;4.对课程设计进行总结,撰写课程设计报告。三.课程设计任务及工作量的要求〔包括课程设计计算说明书、图纸、实物样品等要求〕设计任务: 1.基本任务:⑴采用循环程序软件延时的方法实现信号灯定时变化;⑵采用8255A的C口输入模拟控制开关信号,A口控制信号灯的亮灭,B口控制数码管同时显示东西、南北方向的通行倒计时时间,实现功能要求。2.附加任务:⑴采用8253硬件定时、软件查询方法实现信号灯定时变化。⑵能够通过实验仪上的2X8键盘修改A、B道的放行时间。工作量要求:1.设计的程序流程图和硬件连接图;2.汇编语言源程序代码;3.系统运行结果符合课程设计要求。四.源程序代码.MODELTINYDATASEGMENTPA_8255AEQU0F000HPB_8255AEQU0F001HPC_8255AEQU0F002HCMD_8255AEQU0F003HCMD_8253EQU0B003HT0_8253EQU0B000HT1_8253EQU0B001HT2_8253EQU0B002HIO8259_0EQU0D000HIO8259_1EQU0D001HLEDCONTDB20H,18HSL5DB0SL6DB0SL7DB0MSDB0STATEDB0LEDBUFDB4DUP(?).STACK300WR_COM_LEQU09004HWR_COM_REQU09000HWR_DATA_LEQU09006H WR_DATA_REQU09002HRD_BUSYEQU09001HRD_DATAEQU09003HXEQU0B8HYEQU040HFIRSTLINEEQU0C0HD0DB00H,0E0H,10H,08H,08H,10H,0E0H,00H,00H,0FH,10H,20H,20H,10H,0FH,00HDB00H,10H,10H,0F8H,00H,00H,00H,00H,00H,20H,20H,3FH,20H,20H,00H,00HDB00H,70H,08H,08H,08H,88H,70H,00H,00H,30H,28H,24H,22H,21H,30H,00HDB00H,30H,08H,88H,88H,48H,30H,00H,00H,18H,20H,20H,20H,11H,0EH,00HDB00H,00H,0C0H,20H,10H,0F8H,00H,00H,00H,07H,04H,24H,24H,3FH,24H,00HDB00H,0F8H,08H,88H,88H,08H,08H,00H,00H,19H,21H,20H,20H,11H,0EH,00HDB00H,0E0H,10H,88H,88H,18H,00H,00H,00H,0FH,11H,20H,20H,11H,0EH,00HDB00H,38H,08H,08H,0C8H,38H,08H,00H,00H,00H,00H,3FH,00H,00H,00H,00HDB00H,70H,88H,08H,08H,88H,70H,00H,00H,1CH,22H,21H,21H,22H,1CH,00HDB00H,0E0H,10H,08H,08H,10H,0E0H,00H,00H,00H,31H,22H,22H,11H,0FH,00HGGDB20H,30H,0AFH,62H,30H,20H,0A2H,2AH,2AH,0EAH,2AH,2AH,0BEH,20H,20H,00HDB22H,23H,12H,12H,00H,10H,08H,45H,82H,7FH,02H,05H,08H,18H,08H,00HRRDB20H,30H,2CH,0A3H,60H,18H,00H,08H,08H,08H,0F8H,08H,08H,0CH,08H,00HDB22H,66H,23H,12H,12H,52H,40H,40H,40H,40H,7FH,40H,40H,60H,40H,00HYYDB20H,24H,24H,0A4H,0A4H,0BFH,0A4H,0E4H,0A4H,0BFH,0A4H,0A4H,24H,24H,20H,00H DB00H,80H,80H,5FH,32H,12H,12H,1FH,12H,12H,32H,5FH,0C0H,00H,00H,00HAKOUDB00H,00H,0C0H,38H,0E0H,00H,00H,00H,20H,3CH,23H,02H,02H,27H,38H,20HBKOUDB08H,0F8H,88H,88H,88H,70H,00H,00H,20H,3FH,20H,20H,20H,11H,0EH,00HEN1DB00H,3EH,00H,00H,3FH,0C0H,42H,62H,2EH,92H,12H,2AH,26H,62H,20H,00HDB00H,00H,40H,30H,05H,45H,87H,7DH,05H,04H,14H,26H,6CH,00H,00H,00HEN2DB00H,00H,20H,10H,0ACH,0A7H,0A4H,0A4H,0B4H,0ACH,0A4H,0E0H,00H,00H,00H,00HDB00H,20H,38H,00H,3AH,42H,42H,46H,5AH,42H,42H,73H,00H,08H,30H,00HXINGDB10H,08H,84H,0C6H,73H,22H,40H,44H,44H,44H,0C4H,44H,44H,44H,40H,00HDB02H,01H,00H,0FFH,00H,00H,00H,00H,40H,80H,7FH,00H,00H,00H,00H,00Hdisbufdb8dup(0)SHU0DB00H,0E0H,10H,08H,08H,10H,0E0H,00H,00H,0FH,10H,20H,20H,10H,0FH,00HSHU2DB00H,70H,08H,08H,08H,88H,70H,00H,00H,30H,28H,24H,22H,21H,30H,00HSHU1DB00H,10H,10H,0F8H,00H,00H,00H,00H,00H,20H,20H,3FH,20H,20H,00H,00HSHU8DB00H,70H,88H,08H,08H,88H,70H,00H,00H,1CH,22H,21H,21H,22H,1CH,00HLED_DATADBBDBBDBBDBBDBBDBBSHUMADB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FHDATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATA MOVDS,AXMOVES,AXNOPMOVDX,CMD_8255AMOVAL,88HOUTDX,ALCALLms_hCALLinit_8259CALLwrite_intCALLLCD_INITMAIN:CALLCHECKCALLDISPMOVDX,PC_8255AINAL,DXTESTAL,80HJZIIIMOVDX,PC_8255AINAL,DXTESTAL,40HJZIIMOVDX,PC_8255AINAL,DXTESTAL,20HJZI;CALLDELAYTIMECALLDISLINE1;CALLDELAYTIMECALLDISLINE2;CALLDELAYTIMECALLDISLINE3;CALLDELAYTIMECALLDISLINE4;CALLDELAYTIMEI:CALLDISLINE5;CALLDELAYTIMEII:CALLDISLINE6;CALLDELAYTIMEIII:CALLDISLINE7;CALLDELAYTIMEJMPMAINCHECKPROCNEAR MOVDX,PC_8255AINAL,DXTESTAL,80HJNZK6K7:CALLDISLINE7MOVAL,BMOVDX,PA_8255AOUTDX,ALMOVAX,0FFHP1:CALLDELAYSUBAX,1JNZP1MOVAL,BMOVDX,PA_8255AOUTDX,ALMOVAX,0FFHP2:CALLDELAYSUBAX,1JNZP2MOVDX,PC_8255AINAL,DXTESTAL,40HJZK6MOVDX,PC_8255AINAL,DXTESTAL,20HJZK5JMPCHECKK6:TESTAL,40HJNZK5MOVSL6,1MOVAL,BMOVDX,PA_8255AOUTDX,ALJMPK0K5:TESTAL,20HJNZK0MOVSL5,1MOVAL,B MOVDX,PA_8255AOUTDX,ALK0:RETCHECKENDPms_hPROCNEARMOVDX,CMD_8253MOVAL,36HOUTDX,ALMOVDX,T0_8253MOVAL,12HOUTDX,ALMOVAL,7AHOUTDX,ALRETms_hENDPinit_8259PROCNEARMOVDX,IO8259_0MOVAL,13HOUTDX,ALMOVDX,IO8259_1MOVAL,08HOUTDX,ALMOVAL,09HOUTDX,ALMOVAL,0FEHOUTDX,ALRETinit_8259ENDPwrite_intPROCNEARPUSHESMOVAX,0MOVES,AXMOVDI,20HLEAAX,INT_0STOSWMOVAX,CSSTOSWPOPESRETwrite_intENDP INT_0:PUSHBXPUSHAXPUSHDXINCMSMOVAL,MSCMPAL,2JNZstop_int1MOVDX,PC_8255AINAL,DXTESTAL,80HJZstop_int1MOVDX,PC_8255AINAL,DXTESTAL,40HJZstop_int1MOVDX,PC_8255AINAL,DXTESTAL,20HJZstop_int1CMPSTATE,0JZSTATE0CMPSTATE,1JZSTATE1CMPSTATE,2JZSTATE2JMPSTATE3stop_int1:JMPstop_intSTATE0:MOVAL,BMOVDX,PA_8255AOUTDX,ALMOVBX,OFFSETLEDCONTMOVAL,[BX]DECALDASMOV[BX],ALINCBXMOVAL,[BX]DECALDASMOV[BX],ALCMPAL,0JNZstop_int3MOVBX,OFFSETLEDCONT MOV[BX],2INCBXMOV[BX],2INCSTATEstop_int3:JMPstop_intSTATE1:MOVAL,BMOVDX,PA_8255AOUTDX,ALMOVBX,OFFSETLEDCONTMOVAL,[BX]DECALDASMOV[BX],ALINCBXMOVAL,[BX]DECALDASMOV[BX],ALCMPAL,0JNZstop_intMOVBX,OFFSETLEDCONTMOV[BX],18HINCBXMOV[BX],20HINCSTATEJMPstop_intSTATE2:MOVAL,BMOVDX,PA_8255AOUTDX,ALMOVBX,OFFSETLEDCONTMOVAL,[BX]DECALDASMOV[BX],ALCMPAL,0JNZGOMOVBX,OFFSETLEDCONTMOV[BX],2INCBXMOV[BX],2INCSTATEGO:INCBX MOVAL,[BX]DECALDASMOV[BX],ALJMPstop_intSTATE3:MOVAL,BMOVDX,PA_8255AOUTDX,ALMOVBX,OFFSETLEDCONTMOVAL,[BX]DECALDASMOV[BX],ALINCBXMOVAL,[BX]DECALDASMOV[BX],ALCMPAL,0JNZstop_intMOVBX,OFFSETLEDCONTMOV[BX],21HINCBXMOV[BX],19HMOVSTATE,0JMPstop_intstop_int:MOVDX,IO8259_0MOVAL,20HOUTDX,ALPOPDXPOPAXPOPBXIRETDISPPROCSTIMOVDI,OFFSETLEDCONTMOVCL,4MOVAL,[DI]MOVAH,ALSHRAL,CL MOVBX,OFFSETSHUMAXLATMOVLEDBUF,ALMOVAL,AHANDAL,0FHMOVBX,OFFSETSHUMAXLATMOVLEDBUF+1,ALINCDIMOVAL,[DI]MOVAH,ALSHRAL,CLMOVBX,OFFSETSHUMAXLATMOVLEDBUF+2,ALMOVAL,AHANDAL,0FHMOVBX,OFFSETSHUMAXLATMOVLEDBUF+3,ALDIS1:MOVSI,OFFSETLEDBUFMOVCL,4STCMOVAH,BDLOOP:MOVDX,0F002HMOVAL,0FFHOUTDX,ALMOVAL,[SI]MOVDX,0F001HOUTDX,ALMOVDX,0F002HMOVAL,AHOUTDX,ALPUSHAXCALLDELAYPOPAXRCRAH,1INCSIDECCLJNZDLOOPMOVDX,0F002HMOVAL,0FFHOUTDX,ALRET DISPENDPDELAYPROCPUSHAXPUSHCXMOVAL,0MOVAH,1MOVCX,AXLOOP$;NOPPOPCXPOPAXRETDELAYENDPDISLINE1PROCNEARCMPSTATE,0JZD1RETD1:MOVBL,16MOVAL,LEDCONTCBWDIVBLMOV[disbuf],AHMOV[disbuf+1],ALMOVAL,LEDCONT+1CBWDIVBLMOV[disbuf+2],AHMOV[disbuf+3],ALLEASI,d0MOVAH,0MOVAL,disbufSHLAX,4ADDSI,AXMOVAL,22MOVAH,8CALLBYTEDISL LEASI,d0MOVAH,0MOVAL,disbuf+1SHLAX,4ADDSI,AXMOVAL,22MOVAH,0CALLBYTEDISLLEASI,RRMOVAL,2MOVAH,0CALLWORDDISLLEASI,d0MOVAH,0MOVAL,disbuf+2SHLAX,4ADDSI,AXMOVAL,22MOVAH,40CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+3SHLAX,4ADDSI,AXMOVAL,22MOVAH,32CALLBYTEDISLLEASI,GGMOVAL,2MOVAH,32CALLWORDDISLRETDISLINE1ENDPDISLINE2PROCNEARCMPSTATE,1JZD2 RETD2:MOVBL,16MOVAL,LEDCONTCBWDIVBLMOV[disbuf],AHMOV[disbuf+1],ALMOVAL,LEDCONT+1CBWDIVBLMOV[disbuf+2],AHMOV[disbuf+3],ALLEASI,d0MOVAH,0MOVAL,disbufSHLAX,4ADDSI,AXMOVAL,22MOVAH,8CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+1SHLAX,4ADDSI,AXMOVAL,22MOVAH,0CALLBYTEDISLLEASI,RRMOVAL,2MOVAH,0CALLWORDDISLLEASI,d0MOVAH,0MOVAL,disbuf+2SHLAX,4ADDSI,AXMOVAL,22 MOVAH,40CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+3SHLAX,4ADDSI,AXMOVAL,22MOVAH,32CALLBYTEDISLLEASI,YYMOVAL,2MOVAH,32CALLWORDDISLRETDISLINE2ENDPDISLINE3PROCNEARCMPSTATE,2JZD3RETD3:MOVBL,16MOVAL,LEDCONTCBWDIVBLMOV[disbuf],AHMOV[disbuf+1],ALMOVAL,LEDCONT+1CBWDIVBLMOV[disbuf+2],AHMOV[disbuf+3],ALLEASI,d0MOVAH,0MOVAL,disbufSHLAX,4ADDSI,AXMOVAL,22 MOVAH,8CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+1SHLAX,4ADDSI,AXMOVAL,22MOVAH,0CALLBYTEDISLLEASI,GGMOVAL,2MOVAH,0CALLWORDDISLLEASI,d0MOVAH,0MOVAL,disbuf+2SHLAX,4ADDSI,AXMOVAL,22MOVAH,40CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+3SHLAX,4ADDSI,AXMOVAL,22MOVAH,32CALLBYTEDISLLEASI,RRMOVAL,2MOVAH,32CALLWORDDISLRETDISLINE3ENDPDISLINE4PROCNEAR CMPSTATE,3JZD4RETD4:MOVBL,16MOVAL,LEDCONTCBWDIVBLMOV[disbuf],AHMOV[disbuf+1],ALMOVAL,LEDCONT+1CBWDIVBLMOV[disbuf+2],AHMOV[disbuf+3],ALLEASI,d0MOVAH,0MOVAL,disbufSHLAX,4ADDSI,AXMOVAL,22MOVAH,8CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+1SHLAX,4ADDSI,AXMOVAL,22MOVAH,0CALLBYTEDISLLEASI,YYMOVAL,2MOVAH,0CALLWORDDISLLEASI,d0MOVAH,0MOVAL,disbuf+2SHLAX,4 ADDSI,AXMOVAL,22MOVAH,40CALLBYTEDISLLEASI,d0MOVAH,0MOVAL,disbuf+3SHLAX,4ADDSI,AXMOVAL,22MOVAH,32CALLBYTEDISLLEASI,RRMOVAL,2MOVAH,32CALLWORDDISLRETDISLINE4ENDPDISLINE5PROCNEARCMPSL5,1JZD5RETD5:DECSL5LEASI,RRMOVAL,2MOVAH,2CALLWORDDISRLEASI,BKOUMOVAL,22MOVAH,2CALLBYTEDISRLEASI,GGMOVAL,2MOVAH,40CALLWORDDISRLEASI,XINGMOVAL,22MOVAH,40CALLWORDDISR CALLLCDCLEARCALLDELAYTIMECALLDELAYTIMERETDISLINE5ENDPDISLINE6PROCNEARCMPSL6,1JZD6RETD6:DECSL6LEASI,GGMOVAL,2MOVAH,2CALLWORDDISRLEASI,AKOUMOVAL,22MOVAH,2CALLBYTEDISRLEASI,RRMOVAL,2MOVAH,40CALLWORDDISRLEASI,XINGMOVAL,22MOVAH,40CALLWORDDISRCALLLCDCLEARCALLDELAYTIMECALLDELAYTIMERETDISLINE6ENDPDISLINE7PROCNEARMOVDX,PC_8255AINAL,DXTESTAL,80HJZD7RETD7:DECSL7LEASI,RR MOVAL,2MOVAH,2CALLWORDDISRLEASI,EN1MOVAL,22MOVAH,2CALLWORDDISRLEASI,RRMOVAL,2MOVAH,40CALLWORDDISRLEASI,EN2MOVAL,22MOVAH,40CALLWORDDISRCALLLCDCLEARCALLDELAYTIMECALLDELAYTIMERETDISLINE7ENDPLCD_INITPROCNEARMOVAL,3EHCALLWRCOMLMOVAL,FIRSTLINECALLWRCOMLMOVAL,3EHCALLWRCOMRMOVAL,FIRSTLINECALLWRCOMRCALLLCDCLEARMOVAL,3FHCALLWRCOMLMOVAL,3FHCALLWRCOMRRETLCD_INITENDPLCDCLEARPROCNEARMOVAL,0 MOVAH,0LCDCLEARL1:PUSHAXMOVCX,64CALLSETXYLLCDCLEARL2:MOVAL,0CALLWRDATALLOOPLCDCLEARL2POPAXINCAXCMPAL,8JNZLCDCLEARL1MOVAL,0MOVAH,0LCDCLEARR1:PUSHAXMOVCX,64CALLSETXYRLCDCLEARR2:XORAL,ALCALLWRDATARLOOPLCDCLEARR2POPAXINCALCMPAL,8JNZLCDCLEARR1RETLCDCLEARENDPBYTEDISLPROCNEARMOVCX,8CALLDISPLRETBYTEDISLENDPWORDDISLPROCNEARMOVCX,16CALLDISPLRETWORDDISLENDPDISPLPROCNEARPUSHAXPUSHCXCALLSETXYL CALLDISPLAYLPOPCXPOPAXINCALCALLSETXYLCALLDISPLAYLRETDISPLENDPBYTEDISRPROCNEARMOVCX,8CALLDISPRRETBYTEDISRENDPWORDDISRPROCNEARMOVCX,16CALLDISPRRETWORDDISRENDPDISPRPROCNEARPUSHAXPUSHCXCALLSETXYRCALLDISPLAYRPOPCXPOPAXINCALCALLSETXYRCALLDISPLAYRRETDISPRENDPLINEDISLPROCNEARMOVCX,64CALLSETXYLCALLDISPLAYLRETLINEDISLENDP LINEDISRPROCNEARMOVCX,64CALLSETXYRCALLDISPLAYRRETLINEDISRENDPDISPLAYLPROCNEARLODSBCALLWRDATALLOOPDISPLAYLRETDISPLAYLENDPDISPLAYRPROCNEARLODSBCALLWRDATARLOOPDISPLAYRRETDISPLAYRENDPSETXYLPROCNEARORAL,XCALLWRCOMLMOVAL,AHORAL,YCALLWRCOMLRETSETXYLENDPSETXYRPROCNEARORAL,XCALLWRCOMRMOVAL,AHORAL,YCALLWRCOMRRETSETXYRENDPWRCOMLPROCNEAR MOVDX,WR_COM_LOUTDX,ALWRCOML1:MOVDX,RD_BUSYINAL,DXTESTAL,80HJNZWRCOML1RETWRCOMLENDPWRCOMRPROCNEARMOVDX,WR_COM_ROUTDX,ALWRCOMR1:MOVDX,RD_BUSYINAL,DXTESTAL,80HJNZWRCOMR1RETWRCOMRENDPWRDATALPROCNEARMOVDX,WR_DATA_LOUTDX,ALWRDATAL1:MOVDX,RD_BUSYINAL,DXTESTAL,80HJNZWRDATAL1RETWRDATALENDPWRDATARPROCNEARMOVDX,WR_DATA_ROUTDX,ALWRDATAR1:MOVDX,RD_BUSYINAL,DXTESTAL,80HJNZWRDATAR1RETWRDATARENDPDELAYTIMEPROCNEARMOVCX,0 NOPRETDELAYTIMEENDPCODEENDSENDSTART五.实验体会这次的交通灯课程设计,我学到了好多东西,对于微机原理的理论知识愈加的深入,对于怎么样能够实现程序和对程序的修改也愈加的成熟,这就是对知识的巩固和联系,而且我通过咨询和求知,更加稳固了我的理论知识,这次的课程设计很有意义。