申请成功的朋友可以先按原理图写写程序...
我在这里提供一个驱动四位总线的LCD1602程序...这个程序可以供大家参考...在STC2052 11.0592M通过...
#include<at89x52.h>
#define uchar unsigned char
#define uint unsigned int
sbit LCD_RS = P3^3;
sbit LCD_RW = P3^4;
sbit LCD_EN = P3^5;
#define LCD_DATA P1
void LCD_Initial(void);
void Read_Busb(void);
void Write_Instruction(uchar In_data);
void Write_Data(uchar In_data);
void Delay(uint Time);
void Display_OneText(uchar x,y,In_data);
void main()
{
Delay(10000);
LCD_Initial();
Display_OneText(0,1,'w');
Display_OneText(1,1,'a');
Display_OneText(2,1,'n');
Display_OneText(3,1,'g');
Display_OneText(4,1,'1');
Display_OneText(5,1,'j');
Display_OneText(6,1,'i');
Display_OneText(7,1,'n');
Display_OneText(8,1,'@');
Display_OneText(9,1,'1');
Display_OneText(10,1,'6');
Display_OneText(11,1,'3');
Display_OneText(12,1,'.');
Display_OneText(13,1,'c');
Display_OneText(14,1,'o');
Display_OneText(15,1,'m');
while(1);
}
void LCD_Initial(void)
{
Delay(10000);
Write_Instruction(0x32);//这个和LCD有关...有人用22 有人用28...看个人了...
Write_Instruction(0x06);
Write_Instruction(0x0c);
}
//读忙;
void Read_Busb(void)
{
LCD_RS=0;
LCD_RW=1;
LCD_EN=0;
LCD_EN=1;
LCD_DATA&=0x0f;
while(LCD_DATA&0x08);
}
//写指令;
void Write_Instruction(uchar In_data)
{
uchar i;
Read_Busb();
i="In"_data>>4;
LCD_EN=0;
LCD_RS=0;
LCD_RW=0;
LCD_EN=1;
LCD_DATA=i;
Delay(100);
LCD_EN=0;
i="In"_data;
LCD_EN=1;
LCD_DATA=i;
Delay(100);
LCD_EN=0;
}
//写数据;
void Write_Data(uchar In_data)
{
uchar i;
Read_Busb();
i="In"_data>>4;
LCD_EN=0;
LCD_RS=1;
LCD_RW=0;
LCD_EN=1;
LCD_DATA=i;
Delay(100);
LCD_EN=0;
i="In"_data;
LCD_EN=1;
LCD_DATA=i;
Delay(100);
LCD_EN=0;
}
//在某一指定地址显示一个字符;
void Display_OneText(uchar x,y,In_data)
{
y&=0x01;
x&=0x0f;
if(y)
{
x|=0x40;
}
x|=0x80;
Write_Instruction(x);
Write_Data(In_data);
}
//延时;
void Delay(uint Time)
{
uint a;
for(a=0;a<Time;a++);
}
水平太差...哈哈...将就下...
用户1415827 2008-5-14 18:55
用户47242 2008-3-24 13:32
wang1jin 2008-1-19 19:04
还可以啊...你去啊.HE HE.
用户129933 2008-1-19 17:30
用户1121609 2008-1-10 21:17
wang1jin 2008-1-7 08:54
我现在都比较忙.加为好友我也估计没有多少时间聊天...HE HE...在EDN的论坛一起交流呀.我经常有空就去.
用户1492773 2008-1-6 23:15
用户42640 2008-1-6 22:10
chris_zxp_481544477 2008-1-6 12:52
我怎么知道申请成功与否呢???
电子邮件也没收到的啊···
用户1211773 2008-1-5 18:44
老大,FM的板子还没开始发送,您发这些代码我们只能眼巴巴的看呀。。。