《单片机实验-单片机并行IO口的应用实验.pdf》由会员分享,可在线阅读,更多相关《单片机实验-单片机并行IO口的应用实验.pdf(3页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、单片机并行 I/O 口的应用实验一、实验目的1、熟悉Proteus软件和Keil 软件的使用方法。2、熟悉单片机应用电路的设计方法。3、掌握单片机并行I/O 口的直接应用方法。4、掌握单片机应用程序的设计和调试方法。二、实验内容或原理1、利用单片机并行I/O 口控制流水灯。2、利用单片机并行I/O 口控制蜂鸣器。三、设计要求1、用 Proteus软件画出电路原理图。要求在P1.0 至 P1.7 口线上分别接LED0 至 LED7 八个发光二极管,在P3.0 口线上接一蜂鸣器。2、编写程序:要求LED0 至 LED7 以秒速率循环右移。3、编写程序:要求LED0 至 LED7 以秒速率循环左移。
2、4、编写程序:要求在灯移动的同时,蜂鸣器逐位报警。四、实验报告要求1、实验目的和要求。2、设计要求。3、实验程序流程框图和程序清单。4、电路原理图。5、实验结果6、实验总结。7、思考题。五、思考题1、编程实现LED0 至 LED7 以十六进制计数规律亮灯?原理图:文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M
3、10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10
4、M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A1
5、0M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A
6、10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3
7、A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L
8、3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4
9、L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3程序清单:/*(1)LED0LED7以秒速率循环右移蜂鸣器逐位报警*/ORG 0000H MAIN:MOV A,#11111110B;赋初值LOOP:MOV P1,A;赋值给 P1 口CPL P3.0 ;低电平有效LCALL DELAY;调用延时电路SETB P3.0 ;控制蜂鸣器叫的时间间隔LCALL DELAY RL A LJMP LOOP DELAY:MOV R7,#0FFH LOOP1:MOV R
10、6,#0F4H LOOP2:MOV R5,#02H DJNZ R5,$;$当前的 PC 值,R5 的内容减1 不为零,继续执行该语句DJNZ R6,LOOP2 DJNZ R7,LOOP1 RET END/*(2)LED0LED7以十六进制计数规律亮灯*/ORG 0000H MOV A,#0FFH LOOP:MOV P1,A LCALL DELAY DEC A CJNE A,#0FFH,LOOP MOV A,#0FFH LJMP LOOP DELAY:MOV R7,#0A7H LOOP1:MOV R6,#0ABH LOOP2:MOV R5,#10H DJNZ R5,$;$当前的 PC 值。R5
11、的内容减 1 不为零DJNZ R6,LOOP2 DJNZ R7,LOOP1 RET END 文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M
12、10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10
13、M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A1
14、0M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A
15、10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3
16、A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L
17、3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3文档编码:CP7Z10F7R7E7 HK9J6O2E1Y1 ZA4L3A10M10E3