十字旋转屏报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
旋转LED显示屏设计与测试
姓名:姜 x
学号: 20112410212
班级:(二)
专业:电子信息工程
一、实验任务
基于视觉暂留原理,设计一种旋转式LED显示屏,使其能够显示预设的文字,图案等。
二、显示原理
人眼在观察景物时,光信号传入大脑神经,需经过一段短暂的时间,光的作用结束后,视觉形象并不立即消失,这种残留的视觉称“后像”,视觉的这一现象则被称为“视觉暂留”。
肉眼在24帧/秒以上就不会看到闪烁的,所以只要保证电机的速度能在一秒转24圈以上,这样的话人眼就觉得旋转的字很稳定很清晰的显示在空中了。
如果我们用电机带动led主板转动,以stc89c52单片机为控制中心,16个io 口分别控制16个led,再加上一个红外发射管,一个红外接收管。
led主板上的红外接收管每转动一圈红外接收管就会导通一次。
一旦导通,单片机检测到引脚的低电平,便让单片机开始有规律的控制16个led的亮灭,这样,由于人眼的“视觉暂留”效应,便能看到显示屏上显示的文字或图像了。
要想准确显示一个字体或者图形,我们就要准确的给16个管脚赋上有规律的高低电平,要想知道怎样赋值,我们需要对文字或者图形取模,因为我们用的是16个led灯,所以我们取一个16*16的中文字,如图1示
图1 对汉字取模
从第一列开始向下每取8个点作为一个字节,如果最后不足8个点就补满8位。
取模顺序是从低到高,即第一个点作为最低位。
取模后数据如下:
0xFF,0x7F,0xFF,0xBF,0x3F,0xC8,0xBF,0xFB,0xBF,0xFB,0xBF,0xEB,0x80,0x9B,0x B7,0xFB,0xB7,0xEB,0xB7,0x9B,0xB7,0xFB,0x37,0xF8,0xF7,0xEF,0xF7,0x1F,0xFF, 0xFF,0xFF,0xFF,/*"点",0*/
现在我们知道16*16取模是一列一列取的了,一列有2个字节,一共16列,所以一个16*16的汉字就有32个字节,需要占用单片机的Code空间32个字节。
Led每旋转一周红外接收管接收信号时,单片机便开始根据取模后的数组开始依次点亮16个led。
这样,便能显示文字或者图形了。
三、硬件设计
控制芯片采用STC89C52,结构框图设计如图2所示
图2 系统结构框图
本系统采用无线供技术。
利用自激震荡电路,把5v直流电压转换成交流电压。
然后通过线圈电磁感应,给led主板供电。
电源电路原理图如图3所示
图3 电源电路原理图
本系统用p2口,p4口,p5口控制16个led灯,次级感应线圈产生感应电压系统电路原理图如图4所示
图4 系统电路原理图
制作完成后,下载硬件测试程序进行测试,如果16个led灯能够全部点亮,
则制作成功,可以作为显示屏使用,硬件测试程序见:六、程序
四、程序分析
本次实验采用查询方式编写程序,程序结构流程图如图5所示
图5 程序流程图
当程序开始运行的时候,首先就是要对程序进行初始化,主要作用就是让程序按照我们所设计的初始值去运行。
初始化之后,当显示屏旋转到接收到红外发射信号时,开始执行显示程序,有规律地点亮16个led灯。
16个led及其对应引脚如图6所示
图6 16个led及其对应引脚
一列灯16个刚好对应16*16一个汉字的一列:2个字节,所以把取模到的数据依次送到P2口和P4 P5口,这里硬件中P4 P5组成一个字节,所以显示程序如下:
for(i=0;i<16;i++) //送16列显示这里只显示一个字。
{
P2=zimo[i*2]; //送数据低位显示
P4=(zimo[i*2+1]);//送数据高位显示这里用了单片机P4 和P5口是LQFP48脚才有的IO口
P5=(zimo[i*2+1])>>4;//这里行和列都是IO口独立驱动的LED
DelayUs(200); //延时让LED亮起来每列延时的时间
P2=0XFF;
P4=P5=0XFF;
}
在什么时候送显示呢?单片机IO一判断到红外接收管接收到起点信号,就开始显示,显示完16列后等待下一次的起点信号。
这样只要电机的速度够快就会稳定的把字显示字空中了。
平面的文字显示同理。
如何让一组文字不断的移动?这就需要一个字幕计数器,旋转LED每旋转一圈,这个字幕计数器就加一,指向下一列,这样不断的刷新,感觉文字就在移动了,程序如下:
j就是字幕计数器,每转一圈j就会加1;
if(KEY==0) //红外接收管判断起始位
{
j++;
if(j>672) //根据显示的字数定义改数值672/16=42个字显示完42个字后重新开始
{
j=0 ;
}
for(i=j;i<128+j;i++) //每转一圈前进一列这里定义一圈中同时显示128/16=8个字,
{
P2=zimo[i*2]; //送数据低位显示
P4=(zimo[i*2+1]);//送数据高位显示这里用了单片机P4 和P5口是LQFP48脚才有的
P5=(zimo[i*2+1])>>4;//这里行和列都是IO口独立驱动的LED
DelayUs(200); //延时让LED亮起来每列延时的时间
P2=0XFF;
P4=P5=0XFF;
}
这样,利用查询法,执行显示程序,便能在显示屏上显示预设的文字或者图形了。
五、实验结果:
我们把程序下载进单片机,接通电源,旋转屏便能显示我们预设好的图形和文字了。
本次实验先显示几个图形,然后滚动显示“郑州大学信息工程学院”几个字。
显示效果如图7所示
图7 实验显示效果
六、程序
硬件测试程序:
#include<stc89c51rc.h>
#define uchar unsigned char
#define uint unsigned int
unsigned char temp=0X0; //4个字节数据组合成一个long型数据方便移位流水测试
uchar count_time=0;
uchar i=0;
uchar j=0;
uchar u=0;
/**************************延时***********************/
//void delay(void) //误差0us
//{
// unsigned char a,b,c;
// for(c=1;c>0;c--)
// for(b=38;b>0;b--)
// for(a=130;a>0;a--);
//}
void Timer0Interrupt(void) interrupt 1
{
TH0 = 0x10; //18.432M 40MS 定时
TL0 = 0x00;
/************************************/
if(++count_time>2) //定时80MS
{
count_time=0;
temp=temp<<1;
if(++i>8)
{
i=0;
temp=0X01;
}
P2=temp;
P0=temp;
}
}
/********************************************/
/*主函数*/
void main()
{
TMOD = 0x01; //方式0
TH0 = 0x10;
TL0 = 0x00; //18.432M 40MS 定时
EA = 1;
ET0 = 1;
TR0 = 1;
// Send_data(0x55); //发一字节数据到串口
while(1)
{
}
}
实验程序(显示图形及文字):
#include "NEW_8051.H"
#define uchar unsigned char
#define uint unsigned int //宏定义
sbit KEY=P3^2; //红外检测起点
//pc2002 设置阳码逐列顺向取模见设置图片
uchar code zimo[]={
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x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0xFB,0xEB,0xFB,0xDB,0xFB,0xBB,0xEB,0x7B,0xF3,0xF
0xFD,0xF7,0x05,0xE7,0x7D,0xB7,0x7D,0x7B,0x01,0xBB,0x7F,0xC0,0xBF,0xBF,0 xDF,0xBB,
0xAF,0xA7,0xB3,0xBE,0xBC,0xB1,0xB3,0x9F,0xAF,0xA7,0xDF,0xB8,0xBF,0xBF, 0xFF,0xFF,/*"验",40*/ ,,
};
/*****n(us)延时子程序*****/
void DelayUs(uint N)
{
uint x ;
for(x=0;x<=N;x++);
}
/*****主函数*****/
void main(void)
{
uint i=0,j=0 ;
// led1=0 ;
//主程序中只检测按键
while(1)
{
if(KEY==0) //红外接收管判断起始位
{
j++;
if(j>704) //根据显示的字数定义改数值704/16=44个字显示完44个字后重新开始
{
j=0 ;
}
for(i=j;i<176+j;i++) //每转一圈前进一列这里定义一圈中同时显示176/16=10个字,
{ //在这个程序中如果此参数设置过大会造成头吃尾的后果,如果过少盲点又会太大
//所以比较麻烦要根据电机速度来调整此参数
P2=zimo[i*2]; //送数据低位显示
P0=zimo[i*2+1];//送数据高位显示
DelayUs(20); //延时让LED亮起来每列延时的时间
P2=0XFF;
P0=0XFF;
}
}
}
}。