欢迎来到天天文库
浏览记录
ID:20509663
大小:606.63 KB
页数:5页
时间:2018-10-13
《单片机ad模数转换实验报告》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、一、实验目的和要求1、掌握单片机与ADC0809的接口设计方法。2、掌握Proteus软件与Keil软件的使用方法。二、设计要求。1、用Proteus软件画出电路原理图,在单片机的外部扩展片外三总线,并通过片外三总线与0809接口。2、在0809的某一模拟量输入通道上接外部模拟量。3、在单片机的外部扩展数码管显示器。4、分别采用延时和查询的方法编写A/D转换程序。5、启动A/D转挽,将输入模拟量的转换结果在显示器上显示。三、电路原理图。J3BOC7OSQ2QODOQ20203&30*0505o?D?LEw鑛a.Ik393PQJD2、5J‘PDSJJ18Fd.73Z1ONE*212?3~,1areU2U6:AZ10ITPOIVA&OXTAL12P03*A>3XTAL2P0.WA>«P0SA>5P07汍>7RSTP2£^2P2.1WSP22TA1DP2JW1P2.WA12ALEP25WJ3职P2»AHP2.7/A15F1DTT2Fi.inrxoP1.irT7Bn>*16"159"TJALEpmT2OT%T£TjS图1、电路仿真图ORG0000HSTART:LJM3、PMAINORG01OOHMAIN:MOVSP,#2FHNT:MOVDPTR,#0FF78HMOVX@DPTR,ALOOP:JBP3.3,LOOPMOVXA,@DPTRMOVB,#51DIVABMOVRO,AMOVA,BMOVB,#5DIVABMOVRl,AMOVR2,BLCALLDIRSJMPNTDIR:MOVR7,#0SJMPLOOP1BH:MOVA,RlMOVR2,ALOOP1:MOVDPTR,#WKMOVA,R7MOVCA,@A+DPTRMOVP2,AMOVDPTR,#DKMOVA,R2MOVCA,@A+DPTR四、实验程序流程框阁和程序清单1、查询法:MOVLCA4、LLINCCJNEMOVMOVMOVCMOVMOVMOVMOVCANLMOVLCALLRETPl,DELAYR7R7,DPTR,A,A,P2,DPTR,A,A,A,Pl,DELAY#2,#WKR7@A+DPTRA#DKRO@A+DPTR#7FHABHDELAY:MOVR5,#01HDL1:MOVR4,#8EHDLO:MOVR3,#02HDJNZR3,$DJNZR4,DLODJNZR5,DL1RETWK:DB10HDB20HDB40HDK:DB0C0H,0F9H,0A4]ENDSTART:ORGLJMPMAIN:ORGMOVLOOP:MOVDIR:MOVXLCALLMOVXM5、OVDIVMOVMOVMOVDIVMOVMOVLCALLSJMPMOVBH:SJMPMOVLOOP1:MOVMOVDELAY:MOVMOVCMOVMOVMOVMOVCMOVLCALLINCCJNEMOVMOVMOVCMOVMOVMOVMOVCANLMOVLCALLRETMOVDL1:MOVDLO:MOVWK:DJNZDJNZDJNZRETDBDBDB2、延时法:OOOOHMAIN01OOHSPDlh'R,@DPTR,DELAYA,B,ABRO,A,B,ABRl,R2,DIRLOOPR7,L00P1A,R2,DPTR,A,A,P2,DPTR,A,A,Pl,DELAYR7R7,6、DPTR,A,A,P2,DPTR,A,A,A,Pl,DELAY#2FH#0FF78HA@DPTR#51AB#5AB#0RlA#WKR7@A+DPTRA#DKR2@A+DPTRA#2,BH#WKR7@A+DPTRA#DKR0@A+DPTR#7FHAmX4,it?rr-rrr-rHHHooo124#01H#8EH#02H$DLODL1displi)DK:DB0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90HEND五、实验结果。图2、仿真结果六、实验总结。巾图4可知,没计要求2的内容己经成功完成;由图5可以看出要求3的内容己经成功完成。通过这7、次实验,掌握了通过8255來扩展单片机的I/OU线,对8255已经有了充分的认识,以实践操作来验证理论知识,学到了很多东西。七、思考题。采用屮断的方法编写A/D转换程序,完成实验要求ORGOOOOHSTART:LJMPMAINORG0013HLJMPINTT1ORG()1OOHMAIN:MOVSP,#2FHSETBEASETBEX1MOVDPTR,#()FF78HMOVX@DPTR,AHERE:LJMPHEREDISPLAY:MOVR7,#0SJMPLOOP1BH:MOVA,R1MOVR2,ALOOP1:MOVDP
2、5J‘PDSJJ18Fd.73Z1ONE*212?3~,1areU2U6:AZ10ITPOIVA&OXTAL12P03*A>3XTAL2P0.WA>«P0SA>5P07汍>7RSTP2£^2P2.1WSP22TA1DP2JW1P2.WA12ALEP25WJ3职P2»AHP2.7/A15F1DTT2Fi.inrxoP1.irT7Bn>*16"159"TJALEpmT2OT%T£TjS图1、电路仿真图ORG0000HSTART:LJM
3、PMAINORG01OOHMAIN:MOVSP,#2FHNT:MOVDPTR,#0FF78HMOVX@DPTR,ALOOP:JBP3.3,LOOPMOVXA,@DPTRMOVB,#51DIVABMOVRO,AMOVA,BMOVB,#5DIVABMOVRl,AMOVR2,BLCALLDIRSJMPNTDIR:MOVR7,#0SJMPLOOP1BH:MOVA,RlMOVR2,ALOOP1:MOVDPTR,#WKMOVA,R7MOVCA,@A+DPTRMOVP2,AMOVDPTR,#DKMOVA,R2MOVCA,@A+DPTR四、实验程序流程框阁和程序清单1、查询法:MOVLCA
4、LLINCCJNEMOVMOVMOVCMOVMOVMOVMOVCANLMOVLCALLRETPl,DELAYR7R7,DPTR,A,A,P2,DPTR,A,A,A,Pl,DELAY#2,#WKR7@A+DPTRA#DKRO@A+DPTR#7FHABHDELAY:MOVR5,#01HDL1:MOVR4,#8EHDLO:MOVR3,#02HDJNZR3,$DJNZR4,DLODJNZR5,DL1RETWK:DB10HDB20HDB40HDK:DB0C0H,0F9H,0A4]ENDSTART:ORGLJMPMAIN:ORGMOVLOOP:MOVDIR:MOVXLCALLMOVXM
5、OVDIVMOVMOVMOVDIVMOVMOVLCALLSJMPMOVBH:SJMPMOVLOOP1:MOVMOVDELAY:MOVMOVCMOVMOVMOVMOVCMOVLCALLINCCJNEMOVMOVMOVCMOVMOVMOVMOVCANLMOVLCALLRETMOVDL1:MOVDLO:MOVWK:DJNZDJNZDJNZRETDBDBDB2、延时法:OOOOHMAIN01OOHSPDlh'R,@DPTR,DELAYA,B,ABRO,A,B,ABRl,R2,DIRLOOPR7,L00P1A,R2,DPTR,A,A,P2,DPTR,A,A,Pl,DELAYR7R7,
6、DPTR,A,A,P2,DPTR,A,A,A,Pl,DELAY#2FH#0FF78HA@DPTR#51AB#5AB#0RlA#WKR7@A+DPTRA#DKR2@A+DPTRA#2,BH#WKR7@A+DPTRA#DKR0@A+DPTR#7FHAmX4,it?rr-rrr-rHHHooo124#01H#8EH#02H$DLODL1displi)DK:DB0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90HEND五、实验结果。图2、仿真结果六、实验总结。巾图4可知,没计要求2的内容己经成功完成;由图5可以看出要求3的内容己经成功完成。通过这
7、次实验,掌握了通过8255來扩展单片机的I/OU线,对8255已经有了充分的认识,以实践操作来验证理论知识,学到了很多东西。七、思考题。采用屮断的方法编写A/D转换程序,完成实验要求ORGOOOOHSTART:LJMPMAINORG0013HLJMPINTT1ORG()1OOHMAIN:MOVSP,#2FHSETBEASETBEX1MOVDPTR,#()FF78HMOVX@DPTR,AHERE:LJMPHEREDISPLAY:MOVR7,#0SJMPLOOP1BH:MOVA,R1MOVR2,ALOOP1:MOVDP
此文档下载收益归作者所有