单片机原理与应用实验报告Word格式文档下载.docx

上传人:b****1 文档编号:15396927 上传时间:2022-10-30 格式:DOCX 页数:15 大小:17.25KB
下载 相关 举报
单片机原理与应用实验报告Word格式文档下载.docx_第1页
第1页 / 共15页
单片机原理与应用实验报告Word格式文档下载.docx_第2页
第2页 / 共15页
单片机原理与应用实验报告Word格式文档下载.docx_第3页
第3页 / 共15页
单片机原理与应用实验报告Word格式文档下载.docx_第4页
第4页 / 共15页
单片机原理与应用实验报告Word格式文档下载.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

单片机原理与应用实验报告Word格式文档下载.docx

《单片机原理与应用实验报告Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《单片机原理与应用实验报告Word格式文档下载.docx(15页珍藏版)》请在冰豆网上搜索。

单片机原理与应用实验报告Word格式文档下载.docx

i<

ms;

i++){

for(j=0;

j<

60;

j++);

}

voiddisplay(){

P1=~L;

delay(1000);

main(){

unsignedchari;

L=0xFF;

display();

L=0x00;

while

(1){

L=0x01;

8;

i++){

L=L<

<

1;

display();

}

L=0x80;

display();

for(i=0;

i++){

L=L>

>

/*L右移1位*/

由两边向中间亮:

#include<

j++);

voiddisplay(){

P1=~L;

main(){

while

(1)

{

L=0x01;

i++)

{

L=L<

实验二P1口扩展实验

掌握EL-8051-III型单片机实验系统。

掌握P1口扩展实验中的编程方法,调试程序。

delay(unsignedintms){

unsignedcharj;

unsignedinti;

for(j=0;

unsignedcharK;

P1=0x00;

delay(1000);

P1=0xff;

while

(1){

K=P1&

0x03;

switch(K){

case0:

P1=0xff;

break;

case1:

P1=0xf3;

case2:

P1=0xcf;

case3:

P1=0x03;

default:

break;

}

实验三简单I/O口扩展实验

——交通灯控制实验

学习在单片机系统中扩展简单I/O接口的方法。

掌握交通灯控制的编程方法,调试程序。

unsignedcharxdata*codeL=0xCFA0;

for(j=0;

unsignedchari;

*L=0xff;

*L=~0x81;

delay(3000);

for(i=0;

=9;

*L=~0x21;

delay(1000);

}

*L=~0x01;

delay(100);

=4;

*L=~0x41;

delay(200);

*L=~0x01;

delay(500);

*L=~0x84;

*L=~0x80;

*L=~0x82;

*L=~0x80;

}

实验四中断实验

——有急救车的交通灯控制实验

学习中断处理程序的编程方法。

掌握急救车的交通灯控制的编程方法,调试程序。

unsignedcharxdata*codeL=0xCFB0;

sbitflag=P3^2;

voidsevice_int0()interrupt0using2{

unsignedchari=10;

flag=1;

while(i--){

*L=0x7e;

delay(1000);

IP=0x01;

IE=0x81;

3;

*L=~0x81;

delay(200);

实验五内部定时器实验

学习复合定时的编程方法。

掌握复合定时的编程方法,调试程序。

sbitcontrol=P1^0;

sbitlight=P1^7;

timer0()interrupt1using1{

control=!

control;

TH0=(65536-50000)/256;

TL0=(65536-50000)%256;

timer1()interrupt3using2{

light=!

light;

TMOD=0x61;

TH1=256-5;

TL1=256-5;

IP=0x08;

EA=1;

ET0=1;

ET1=1;

TR0=1;

TR1=1;

while

(1);

实验六内部定时器与中断实验

学习内部定时器/计数器的使用和编程方法。

掌握定时器与中断复合编程方法,调试程序。

unsignedinti=0,a=0;

unsignedintl[16]={0x18,0x3C,0x7E,0xFF,0xE7,0xC3,0x81,0x00,0x81,0xC3,0xE7,0xFF,0x7E,0x3C,0x18,0x00};

unsignedintb[16]={0x81,0x00};

unsignedintj;

inti;

10;

P1=~b[0];

P1=~b[1];

timer0()interrupt1using1{

i++;

if(i>

=5){

i=0;

if(a>

15){

a=0;

P1=~l[a];

a++;

main(){

inta;

IE=0x83;

TMOD=0x01;

实验七数码显示实验

学习数码管显示数字的原理。

掌握动态扫描键盘的方法,调试程序。

unsignedcharBUF=0;

/*定时器每中断一次BUF加1*/

unsignedcharSBF0=0,SBF1=0,MBF0=0,MBF1=0;

/*秒、分各位清零*/

unsignedcodetable[11]={0x3f,0x06,0x5b,0x4f,

0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x40};

/*数码管真值表*/

unsignedxdata*L=0xcfa0;

/*74LS273端口地址*/

delay(unsignedintms)/*延时子程序*/

{unsignedcharj;

unsignedin

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 职业教育 > 职业技术培训

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1