我就不懂了,51单片机的程序就那么简单,这个怎么回事啊?是我在这方面不懂?
请前辈给我指点一下,或者给我发个程序
我的单片机程序是非常简单的,那DSP的呢??
#include<reg52.h>
sbit en=P2^6;
sbit wr=P2^5;
sbit rs=P2^4;
void init();
void dely(unsigned int m);
void write_kong(unsigned char com);
void write_shu(unsigned char shu);
unsigned char code table[]="I Like MCU!";
unsigned char code table1[]="Zhao chun mei!";
unsigned char num,num1;
void main()
{
en=0;
write_kong(0x38);
write_kong(0x0f); //光标闪烁
write_kong(0x06); //输入方式 读写操作后 光标 画面平移
write_kong(0x01);
write_kong(0x80);
for(num=0;num<11;num++)
{
write_shu(table[num]);
dely(10000);
}
// write_kong(0x01);
write_kong(0x80+0x41 );
for(num1=0;num1<14;num1++)
{
write_shu(table1[num1]);
dely(10000);
}
for(num=0;num<16;num++)
{
write_kong(0x18);
dely(10000);
}
while(1);
}
void write_kong(unsigned char com)
{
dely(100);
en=0;
wr=0;
rs=0;
P0=com;
dely(100);
en=1;
dely(100);
en=0;
}
void write_shu(unsigned char shu)
{ dely(100);
en=0;
wr=0;
rs=1;
P0=shu;
dely(100);
en=1;
dely(100);
en=0;
rs=0;
}
void dely(unsigned int m)
{
while(m--);
} |