资源描述:
《可编程计数器定时器8254》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、课程名称汇编语言与微机原理实验名称8254定时/计数器应用实验实验目的、要求1.掌握8254的工作方式及应用编程。2.掌握8254典型应用电路的接法。实验原理编写程序,将8254的计数器0设置为方式3,计数值为十进制数4,用单次脉冲KK1+作为CLK0时钟,OUT0连接INTR,每当KK1+按动5次后产生中断请求,在屏幕上显示字符"5"。主要设备、器材PC机一台,TD-PIT实验装置一套实验步骤及原始数据记录(1)实验接线如图4-6-3所示。(2)运行Tdpit集成操作软件,根据实验内容,编写实验程序,编译、链接。(3)运
2、行程序,按动KK1+产生单次脉冲,观察实验现象。(4)改变计数值,验证8254的计数功能。89INTR_IVADDEQU01C8HINTR_OCW1EQU0A1HINTR_OCW2EQU0A0HINTR_IMEQU0FBHIOY0EQU3000HMY8254_COUNT0EQUIOY0+00H*4MY8254_COUNT1EQUIOY0+01H*4MY8254_COUNT2EQUIOY0+02H*4MY8254_MODEEQUIOY0+03H*4STACK1SEGMENTSTACKDW256DUP(?)STACK1ENDS
3、DATASEGMENTCS_BAKDW?IP_BAKDW?IM_BAKDB?STR1DB'COUNT:$'DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXCLIMOVAX,0000HMOVES,AXMOVDI,INTR_IVADDMOVAX,ES:[DI]MOVIP_BAK,AXMOVAX,OFFSETMYISRMOVES:[DI],AXADDDI,2MOVAX,ES:[DI]MOVCS_BAK,AXMOVAX,SEGMYISRMOVES:[D
4、I],AXMOVDX,INTR_OCW1INAL,DXMOVIM_BAK,ALANDAL,INTR_IMOUTDX,ALSTIMOVDX,OFFSETSTR1MOVAH,9INT21HMOVDX,MY8254_MODEMOVAL,10HOUTDX,ALMOVDX,MY8254_COUNT0MOVAL,4OUTDX,ALWAIT1:MOVAH,1INT16HJZWAIT1QUIT:CLIMOVAX,0000HMOVES,AXMOVDI,INTR_IVADDMOVAX,IP_BAKMOVES:[DI],AXADDDI,2MOV
5、AX,CS_BAKMOVES:[DI],AXMOVDX,INTR_OCW1MOVAL,IM_BAKOUTDX,ALSTIMOVAX,4C00HINT21HMYISRPROCNEARPUSHAXMOVAL,35HMOVAH,0EHINT10HMOVAL,20HINT10HMOVDX,MY8254_COUNT0MOVAL,4OUTDX,ALOVER:MOVDX,INTR_OCW2MOVAL,20HOUTDX,ALMOVAL,20HOUT20H,ALPOPAXIRETMYISRENDPCODEENDSENDSTART实验结果1.
6、程序运行之后,KK1+按动5次后产生中断请求,在屏幕上显示字符"5"。