您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 酒店餐饮 > 微型计算机原理与接口实验
1/13微型计算机原理与接口实验报告实验一I/O地址译码一.实验目的:掌握I/O地址译码电路的工作原理二.实验仪器:U374LS13874LS7474LS00PCTPC-ZK实验系统三.实验总体思路:先使灯亮,延时,然后灭,不断循环四.实验内容:实验电路如图1-1所示,其中74LS74为D触发器,可直接使用实验台上数字电路实验区的D触发器,74LS138为地址译码器。译码输出端Y0~Y7在实验台上“I/O地址”输出端引出,每个输出端包含8个地址,Y0:280H~287H,Y1:288H~28FH,当CPU执行I/O指令且地址在280H~2BFH范围内,译码器选中,必有一根译码线输出负脉冲。五.实验代码:DATASSEGMENTAADBAOHBBDBA8HDATASENDSSTACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:PUSHDSMOVAX,0PUSHAXMOVAX,DATASMOVDS,AXCIR:MOVAL,AAMOVDX,2A0HOUTDX,AL;输出A0H,灯亮CALLDELAYMOVAL,BB;输出A8H,灯灭MOVDX,2A8OUTDX,ALJMPCIRMOVAH,4CHINT21HDELAYPROCFAR;延时函数2/13MOVBX,100WAIT:MOVCX,2601FLASH:LOOPFLASHDECBXJNZWAITRETDELAYENDPCODESENDSENDSTART六.实验结果:L7闪烁发光(亮、灭、亮、灭、„„)实验二存储器读写实验一.实验内容:编制程序,将字符A-Z循环写入扩展的RAM中,然后再将扩展的RAM内容读出来显示在主机屏幕上。二.实验目的:1、熟悉6264静态RAM的使用方法,掌握PC机外存扩充的手段。2、通过对硬件电路的分析,学习了解总线的工作时序。三.实验仪器:2K的6264TPC-ZK实验系统PC四.实验总体思路:五.实验代码:DATASSEGMENTMESSAGEDB'ANYKEYTOSHOWTHECONTENTS!',0DH,0AH,'$'DATASENDS3/13STACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;此处输入代码段代码MOVAX,0D000HMOVES,AX;initesMOVBX,6000H;EA=06000HSTARTFROMPA=0D6000HMOVCX,100HMOVDL,41HWRITE:;WRITEREAPTLYMOVES:[BX],DLINCBXINCDLCMPDL,5AHJLECIRMOVDL,41HCIR:LOOPWRITE;KEYOUT&INMOVDX,OFFSETMESSAGEMOVAH,9INT21HMOVAH,01HINT21H;WAITMOVAX,0D000HMOVES,AXMOVBX,6000HMOVCX,0100HREAD:MOVDL,ES:[BX]MOVAH,02HINT21HINCBXLOOPREADMOVAH,4CHINT21HCODESENDS4/13ENDSTART六.实验结果:主机屏幕上显示字符A-Z实验三可编程并行接口一.实验内容:1.实验电路如图4-3-1,8255C口接逻辑电平开关K0~K7,A口接LED显示电路L0~L7。2.编程从8255C口输入数据,再从A口输出。二.实验目的:通过实验,掌握8255工作于方式0以及设置A口为输出口,C口为输入口的方法三.实验仪器:TPC-ZK实验系统四.实验总体思路:五实验步骤:DATASSEGMENT;此处输入数据段代码MESSDB'ANYKEYTOEXITTODOS!',0DH,0AH,'$'DATASENDSSTACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATAS5/13MOVDS,AX;此处输入代码段代码MOVAH,09HMOVDX,OFFSETMESSINT21HINIT:MOVDX,28BHMOVAL,89HOUTDX,ALREAD:MOVDX,28AHINAL,DXMOVDX,288HOUTDX,ALMOVAH,06HMOVDL,0FFHINT21HJNZEXITJMPREADEXIT:MOVAX,4C00HINT21HMOVAH,4CHINT21HCODESENDSENDSTART六.实验结果:通过逻辑电平开关可以控制LED灯的亮灭。实验四可编程定时器/计数器一.实验内容:1.按图4-8-1虚线连接电路,将计数器0设置为方式0,计数器初值为N(N≤0FH),用手动逐个输入单脉冲,编程使计数值在屏幕上显示,并同时用逻辑笔观察OUT0电平变化(当输入N+1个脉冲后OUT0变高电平)。2.按图3-2连接电路,将计数器0、计数器1分别设置为方式3,计数初值设为1000,用逻辑笔观察OUT1输出电平的变化(频率1HZ)。二.实验目的:掌握可编程定时器/计数器基本工作原理和编程方法,观察不同方式下的波形三.实验仪器:TPC-ZK实验系统四.实验总体思路:6/13五.实验步骤:实验(一)DATASSEGMENT;此处输入数据段代码DATASENDSSTACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;此处输入代码段代码MOVDX,0283HMOVAL,10HOUTDX,ALMOVDX,0280HMOVAL,0EH;AFTER15HIGHOUTDX,ALREAD:MOVDX,0280HINAL,DXPUSHDXCALLDISPLAYPOPDXMOVAH,06MOVDL,0FFHINT21H7/13JZREADMOVAH,4CHINT21HDISPLAYPROCNEAR;PUSHDX;MOVBL,0EH;SUBBL,AL;XCHGAL,BLMOVDL,ALCMPDL,9JLEACIADDDL,7ACI:ADDDL,30HMOVAH,02INT21HMOVDL,0DHINT21HMOVDL,0AHINT21H;POPDXRETDISPLAYENDPCODESENDSENDSTART实验(二)DATASSEGMENT;此处输入数据段代码DATASENDSSTACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;此处输入代码段代码MOVDX,0283HMOVAL,36HOUTDX,AL8/13MOVDX,0280HMOVAL,0E8HOUTDX,ALMOVAL,03HOUTDX,ALMOVDX,0283HMOVAL,76HOUTDX,ALMOVDX,0281HMOVAL,0E8HOUTDX,ALMOVAL,03HOUTDX,ALMOVAH,4CHINT21HCODESENDSENDSTART六.实验结果:1.手动逐个输入单脉冲,计数值在屏幕上显示,数值递减2.逻辑笔观察OUT1输出电平的变化(频率1HZ),左右两灯交替闪烁实验五中断一.实验内容:1、中断IRQ3实验,实验电路如图4-12-1,直接用手动产生单脉冲2作为中断请求信号(只需连接一根导线)。要求每按一次开关产生一次中断,在屏幕上显示一次“TPCAInterrupt!”,中断10次后程序退出。2、中断IRQ10实验,实验电路如图4-12-1,用手动产生单脉冲1作为中断请求信号,每按一次开关产生一次中断,在屏幕上显示一次“”,中断10次后退出。3、中断嵌套实验,实验电路如图4-12-1,分别用手动产生单脉冲作为中断IRQ3和IRQ10的请求信号,申请中断IRQ3后,进入中断3程序,再申请高级中级IRQ10。二.实验目的:1、掌握PC机中断处理系统的基本原理。2、学会编写中断服务程序。三.实验仪器:TPC-ZK实验系统四.实验总体思路:中断IRQ3实验9/13中断IRQ10实验:中断嵌套实验五.实验步骤:实验(一)DATASSEGMENT;此处输入数据段代码MESSAGEDB'TCPAInterrupt!',0AH,0DH,'$'DATASENDSSTACKSSEGMENT10/13;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;此处输入代码段代码MOVAX,CX;INITINTERRUPTADDRESSMOVDS,AXMOVDX,OFFSETINTERMOVAX,250BHINT21HCLI;CLOSEINTERRUPTINAL,21H;SETUPIRQ3,SAVEOTHERSTATUSANDAL,0F7HOUT21H,ALMOVCX,10STI;OPENINTERRUPTHERE:JMPHERE;.................................................................INTERPROCFARMOVAX,DATAS;SHOWTHEMESSAGEWHENINTERRUPTMOVDS,AXMOVDX,OFFSETMESSAGEMOVAH,09INT21H;.................................................................MOVAL,20HOUT20H,ALSUBCX,1JNZNEXTINAL,21HORAL,08HOUT21H,ALSTIMOVAH,4CHINT21HNEXT:IRETINTERENDPCODESENDSENDSTART11/13实验(二)DATASSEGMENT;此处输入数据段代码MESSAGEDB'TCPAInterrupt!',0AH,0DH,'$'DATASENDSSTACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;此处输入代码段代码MOVAX,CX;INITINTERRUPTADDRESSMOVDS,AXMOVDX,OFFSETINTERMOVAX,2507HINT21HCLI;CLOSEINTERRUPTINAL,0A1H;SETUPIRQ3,SAVEOTHERSTATUSANDAL,0F7HOUT0A1H,ALMOVCX,10STI;OPENINTERRUPTHERE:JMPHERE;.................................................................INTERPROCFARMOVAX,DATAS;SHOWTHEMESSAGEWHENINTERRUPTMOVDS,AXMOVDX,OFFSETMESSAGEMOVAH,09INT21H;.................................................................MOVAL,20HOUT0A0H,ALSUBCX,1JNZNEXTINAL,0A1HORAL,08HOUT0A1H,ALSTI12/13MOVAH,4CHINT21HNEXT:IRETINTERENDPCODESENDSENDSTART实验(三)DATASEGMENTMESS3DB'TPCA3Interrupt!',0AH,0DH,'$'MESS10DB'T
本文标题:微型计算机原理与接口实验
链接地址:https://www.777doc.com/doc-6185619 .html