// 12864 ST7920 串口程序
//*******************************************************************
********
//并口程序只需要修改一下底层的 WriteCommand() WriteData()即可.
//毕竟并口比串口简单一些,如果有不明白的请联系.
//*******************************************************************
********
//连线表: CPU=89C52 SystemClock=12Mhz
*
//CS=P3.0 SCLK=P3.1 SID=P3.2 Reset=CPU 复位信
号取反*
//*******************************************************************
********
#include <reg52.h>
#include <intrins.h>
sbit CS =P3^0;
sbit SCK=P3^1;
sbit SID=P3^2;
sbit Key=P3^4;
unsigned char code AC_TABLE[]={
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,
0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,
};
unsigned char code str2[]="欢迎光临 lcdbbs!!";
unsigned char code str1[]="故人西辞黄鹤楼,烟花三月下扬州。孤帆远影
碧空尽,唯见长江天际流。";
unsigned char code bmp1[];
void SendByte(unsigned char Dbyte)
{
unsigned char i;
for(i=0;i<8;i++)
{
SCK = 0;
Dbyte=Dbyte<<1;
SID = CY;
SCK = 1;
SCK = 0;
}
}
评论14