在串行通信中没有SCON设定,也没TI 设定,程序还能仿真成功
时间:10-02
整理:3721RD
点击:
#include <reg52.h>
#define uchar unsigned char
sbit ST_CP=P3^2;
uchar code bmp[32*8]={ //字模表
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
0x80,0x08,0x84,0x08,0x44,0x08,0x44,0x08,0x24,0x09,0x14,0x49,0x0C,0x89,0xFF,0x79,0x0C,0x0D,0x14,0x0B,0x24,0x09,0x44,0x08,0x44,0x08,0x84,0x08,0x80,0x08,0x00,0x00,/*"李",1*/
0x80,0x80,0x80,0x60,0xBE,0x1C,0xAA,0x20,0xAA,0x7F,0xAA,0x44,0xBE,0x44,0x80,0x44,
0x02,0x50,0xF2,0x4B,0x1A,0x44,0xD6,0x43,0x12,0x44,0xF2,0x4B,0x02,0x50,0x00,0x00,/*"题",6*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",7*/
};
void delay(uchar ms) // 延时毫秒@12M,ms最大值255
{
uchar i;
while(ms--)
for(i=0;i<110;i++);
}
void main()
{uchar base,col;
while(1)
{
for(base=0;base<=224;base=base+2) //控制移动效果。偶数 32*(8-1)=224;
{
for(col=0;col<16;col++) // 显示一个汉字
{
SBUF=bmp[base+col*2];
delay(1);
SBUF=bmp[base+col*2+1];
delay(1);
P1=col;
ST_CP=0; //CP上升沿
ST_CP=1; //移位寄存器的数据进入数据存储寄存器 delay(1); //延时显示
}
}
}
}
这个程序是关于led上写汉字的,但是程序中却没有SCON设定,也没TI 设定,程序还能仿真成功
#define uchar unsigned char
sbit ST_CP=P3^2;
uchar code bmp[32*8]={ //字模表
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
0x80,0x08,0x84,0x08,0x44,0x08,0x44,0x08,0x24,0x09,0x14,0x49,0x0C,0x89,0xFF,0x79,0x0C,0x0D,0x14,0x0B,0x24,0x09,0x44,0x08,0x44,0x08,0x84,0x08,0x80,0x08,0x00,0x00,/*"李",1*/
0x80,0x80,0x80,0x60,0xBE,0x1C,0xAA,0x20,0xAA,0x7F,0xAA,0x44,0xBE,0x44,0x80,0x44,
0x02,0x50,0xF2,0x4B,0x1A,0x44,0xD6,0x43,0x12,0x44,0xF2,0x4B,0x02,0x50,0x00,0x00,/*"题",6*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",7*/
};
void delay(uchar ms) // 延时毫秒@12M,ms最大值255
{
uchar i;
while(ms--)
for(i=0;i<110;i++);
}
void main()
{uchar base,col;
while(1)
{
for(base=0;base<=224;base=base+2) //控制移动效果。偶数 32*(8-1)=224;
{
for(col=0;col<16;col++) // 显示一个汉字
{
SBUF=bmp[base+col*2];
delay(1);
SBUF=bmp[base+col*2+1];
delay(1);
P1=col;
ST_CP=0; //CP上升沿
ST_CP=1; //移位寄存器的数据进入数据存储寄存器 delay(1); //延时显示
}
}
}
}
这个程序是关于led上写汉字的,但是程序中却没有SCON设定,也没TI 设定,程序还能仿真成功