1. 软件下载
软件连接请去我的百度网盘下载,网盘主要包括:
1. 51单片机的KEIL5
3. 串口下载软件
2. 问题汇总
2.1 错误信息:*** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED
? ? 1. 安装Keil C51 v9.60a版本,即uV5 ? ? 2. 打开uVision5,点击File---License Management,打开License Management窗口,复制右上角的CID ? ? 3. 打开注册机, 在CID窗口里填上刚刚复制的CID,其它设置不变 ? ? 4. 点击Generate生成许可号,复制许可号 ? ? 5. 将许可号复制到License Management窗口下部的New License ID Code,点击右侧的Add?
请把病毒防护软件关闭。?
同时以管理员身份运行。?
2.2 HEX程序下载
3. IIC屏幕显示
字模生成器下载链接如下:
生成文字设置如下:
16X16点阵字符;
{0x10,0x0C,0x04,0x84,0x14,0x64,0x05,0x06,0xF4,0x04,0x04,0x04,0x04,0x14,0x0C,0x00},
{0x04,0x84,0x84,0x44,0x47,0x24,0x14,0x0C,0x07,0x0C,0x14,0x24,0x44,0x84,0x04,0x00},/*"实",2*/
/* (16 X 16 , 宋体 )*/
{0x00,0x00,0x00,0xFF,0x08,0x08,0x08,0x40,0x40,0x40,0xFF,0x20,0x22,0xAC,0x20,0x00},
{0x00,0x7F,0x21,0x21,0x21,0x21,0x7F,0x80,0x40,0x20,0x17,0x18,0x26,0x41,0xF0,0x00},/*"战",3*/
/* (16 X 16 , 宋体 )*/
{0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00},
{0x00,0x00,0x1F,0x08,0x08,0x08,0x08,0x7F,0x88,0x88,0x88,0x88,0x9F,0x80,0xF0,0x00},/*"电",4*/
/* (16 X 16 , 宋体 )*/
{0x80,0x82,0x82,0x82,0x82,0x82,0x82,0xE2,0xA2,0x92,0x8A,0x86,0x82,0x80,0x80,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"子",5*/
/* (16 X 16 , 宋体 )*/
4. 51单片机串口发送程序
void Send(unsigned char dat)
{
SBUF=dat;
while(TI==0);
TI=0;
}
void delay1ms()
{
unsigned char i,j;
for(i=0;i<10;i++)
for(j=0;j<33;j++)
;
}
void delaynms(unsigned char x)
{
unsigned char i;
for(i=0;i<x;i++)
delay1ms();
}
void UartInit()
{
TMOD=0x20; //定时器T1工作于方式2
TH1=0xfd; //根据规定给定时器T1赋初值
TL1=0xfd; //根据规定给定时器T1赋初值
PCON=0x00; //波特率9600
TR1=1; //启动定时器t1
SCON=0x40; //串口工作方式1
}
|