资源描述:
《8253控制扬声器马俊婷20093060》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验报告专业班级计算机0906姓名马俊婷学号20093060实验题目日期实验六、8253控制扬声器实验一、实验目的利用8253设计一个扬声器控制系统,产生1234567(多来咪….)音阶,进而能够实现各种乐曲。二、实验内容利用8253计数器0产生方波,经驱动电路电流放大后驱动扬声器。三、实验电路8253CS接地址译码输出端CS0;8253CLK0接脉冲发生器CLK2插孔,82530UT0接音响输入插孔A.IN8253门控信号GATE0接电平幵关。四、实验程序CODESEGMENTASSUMECS:CODEORG100IIH9:MOVDX,04A6HMOVAL,3611OUTDX,
2、ALMOVDX,04八OHMOVAL,2911OUTDX,ALMOVAL,OBHOUTDX,ALMOVBX,31111:MOVCX,OFFFFH100P$DECBXJNZ11MOVDX,04A0IIMOVAL,0F2HOUTDX,ALMOVAL,09HOUTDX,ALMOVBX,312:MOVCX,OFFFFH1OOP$DECBXJNZ12MOVDX,04A0HMOVAL,ODDHOUTDX,ALMOVAL,08HOUTDX,A1MOVBX,313:MOVCX,OFFFFH1OOP$DECBXJNZ13MOVDX,04A0HMOVAL,5EHOUTDX,ALMOVAL,08HOU
3、TDX,ALMOVBX,314:MOVCX,OFFFFH1OOP$DECBXJNZ14MOVDX,04A0HMOVAL,79HOUTDX,ALMOVAL,07HOUTDX,ALMOVBX,315:MOVCX,OFFFFH1OOP$DECBXJNZ15MOVDX,04A0HMOVAL,0A8HOUTDX,ALMOVAL,06HOUTDX,ALMOVBX,316:MOVCX,OEFFFH1OOP$DECBXJNZ16MOVDX,04A0HMOVAL,OEEHOUTDX,ALMOVAL,OSHOUTDX,ALMOVBX,317:MOVCX,OFFFFH1OOP$DECBXJNZ17MO
4、VDX,04A0HMOVAL,98HOUTDX,ALMOVAL,05HOUTDX,ALMOVBX,318:MOVCX,OEFFFH1OOP$DECBXJNZ18JMPH9CODEENDSENDH9五、思考与练习1、如何改变乐曲的音调及拍节长短?答;改变时钟周期改变音调,改变循环次数可改变节拍长短。2、编制程序使扬声器演奏如下音节:123111231
5、345-
6、答:CODESEGMENTASSUMECS:CODEORG1OOHH9:MOVDX,04A6HMOVAL,36HOUTDX,ALMOVDX,04A0HMOVAL,29HOUTDX,ALMOVAL,0BHOUTDX,ALMOV
7、BX,2H11:MOVCX,0FFFFH1OOP$DECBXJNZ11MOVDX,04A0HMOVAL,0F2HOUTDX,ALMOVAL,09HOUTDX,ALMOVBX,112:MOVCX,0FFFFH1OOP$DECBXJNZ12MOVDX,04A0HMOVAL,0DDHOUTDX,ALMOVAL,08HOUTDX,AIMOVBX,1L33:MOVCX,0FFFFH1OOP$DECBXJNZ133MOVDX,04A0HMOVAL,29HOUTDX,ALMOVAL,0BHOUTDX,ALMOVBX,1HL44:MOVCX,0FFFFH1OOP$DECBXJNZ144MOVDX
8、,04A0HMOVAL,29HOUTDX,ALMOVAL,0BHOUTDX,ALMOVBXJH1111:MOVCX,0FFFFH1OOP$DECBXJNZ1111MOVDX,04A0HMOVAL,0F2HOUTDX,ALMOVAL,09HOUTDX,ALMOVBX,11222:MOVCX,0FFFFH1OOP$DECBXJNZ1222MOVDX,04A0HMOVAL,0DDHOUTDX,ALMOVAL,08HOUTDX,AIMOVBX,1L333:MOVCX,0FFFFH1OOP$DECBXJNZ1333MOVDX,04A0HMOVAL,29HOUTDX,ALMOVAL,0BHO
9、UTDX,ALMOVBXJHle:MOVCX,0FFFFH1OOP$DECBXJNZleMOVDX,04A0HMOVAL,0DDHOUTDX,ALMOVAL,08HOUTDX,A1MOVBXJlq:MOVCX,0FFFFH1OOP$DECBXJNZlqMOVDX,04A0HMOVAL,5EHOUTDX,ALMOVAL,08HOUTDX,ALMOVBX,1lw:MOVCX,0FFFFH1OOP$DECBXJNZlwMOVDX,04A0HMOVAL,79HOUTDX,ALMOVAL,