单片机流水灯实验报告

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

单片机流水灯实验报告

一、实验目的

1、熟练掌握AT89S52-?型开发板的使用方法和注意事项。

2、了解简单单片机应用系统的设计方法。

3、掌握应用KEIL软件编辑、编译源汇编程序的操作方法。

4、掌握应用USBISP烧录软件的操作方法。

5、帮助学生养成良好实验习惯。

二、实验内容

在AT89S52-?开发板上实现8个发光LED“流水”的现象,并通过编写程序控制流水现象。三、实验说明

当8255 的PA口有低电平输出时,相应的发光二极管就会点亮。应用这一原理我们可以容易的点亮一个数码管,例如令PA口输出0111 1111时D1就会点亮。若再把0111 1111向右循环一位,利用PA口输出,就会点亮D2。在发光二极管两次点亮的间隔中加延时程序,让每次点亮停留一段时间,像这样人眼就可以看到“流水” 的现象。

五、实验原理图

六、实验参考程序

#include

#define uchar unsigned char

ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's

#define uint unsigned int

uchar table[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; sbit P00=P0^0;

sbit P01=P0^1;

void delay(uchar t) {

uchar i,j;

for(i=0;i

for(j=0;j<110;j++); }

void main()

{

uchar i;

while(1)

{

P00=1;

delay(2000);

P00=0;

for(i=0;i<8;i++)

{

P1=table[i];

P2=table[i];

delay(2000);

}

P01=1;

delay(2000);

P01=0;

}

}

实物展示:

ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's

(1)单片机最小系统板

相关文档
最新文档