資源描述:
《可編程計(jì)數(shù)器定時(shí)器8254》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、課程名稱匯編語(yǔ)言與微機(jī)原理實(shí)驗(yàn)名稱8254定時(shí)/計(jì)數(shù)器應(yīng)用實(shí)驗(yàn)實(shí)驗(yàn)?zāi)康?、要?.掌握8254的工作方式及應(yīng)用編程。2.掌握8254典型應(yīng)用電路的接法。實(shí)驗(yàn)原理編寫程序,將8254的計(jì)數(shù)器0設(shè)置為方式3,計(jì)數(shù)值為十進(jìn)制數(shù)4,用單次脈沖KK1+作為CLK0時(shí)鐘,OUT0連接INTR,每當(dāng)KK1+按動(dòng)5次后產(chǎn)生中斷請(qǐng)求,在屏幕上顯示字符"5"。主要設(shè)備、器材PC機(jī)一臺(tái),TD-PIT實(shí)驗(yàn)裝置一套實(shí)驗(yàn)步驟及原始數(shù)據(jù)記錄(1)實(shí)驗(yàn)接線如圖4-6-3所示。(2)運(yùn)行Tdpit集成操作軟件,根據(jù)實(shí)驗(yàn)內(nèi)容,編寫實(shí)驗(yàn)程序,編譯、鏈接。(3)運(yùn)
2、行程序,按動(dòng)KK1+產(chǎn)生單次脈沖,觀察實(shí)驗(yàn)現(xiàn)象。(4)改變計(jì)數(shù)值,驗(yàn)證8254的計(jì)數(shù)功能。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實(shí)驗(yàn)結(jié)果1.
6、程序運(yùn)行之后,KK1+按動(dòng)5次后產(chǎn)生中斷請(qǐng)求,在屏幕上顯示字符"5"。