单片机,protues,液晶显示

一、PG12864F液晶介绍:

二、PROTUES仿真电路图:

2、元器件表:

三、keil软件字模设置:

取模方式:C51.

四、C语言程序代码
#include
//数据类型符号定义
#define uchar unsigned char
#define uint unsigned int
#define BytePerline 16
#define Lines 64
//LCD引线定义
sbit ce=P2^2;
sbit rst=P2^3;
sbit cd=P2^4;
sbit wr=P2^5;
sbit rd=P2^6;
//函数声明
void delay100us(unsigned char t);
void write_data(uchar dat);
void write_cmd1(uchar cmd);// 无参数写命令
void write_cmd2(uchar dat,uchar cmd);//一个参数写命令
void write_cmd3(uchar data1,uchar data2,uchar cmd);//两个参数写命令
uchar read_status();
void check_status();
void clear_screen();
void init_12864();
void display_HZ(uchar x,uchar y,uchar hz);
//定义汉字字模数组
uchar code Name[32][32]=
{
//
****************************************************************************************************
//取模方式:横向取模,字节非倒序
//*****************************************************************************************************
/– 文字: 葡 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/
{0x00,0x00,0x00,0x60,0x07,0x70,0x07,0xFC,0x3F,0x60,0x0E,0x78,0x1F,0xD8,0x3F,0xF8,
0x3F,0x98,0x3F,0xD8,0x1F,0xD8,0x1F,0xD8,0x3F,0xD8,0x3F,0xD8,0x00,0x78,0x00,0x00},

/– 文字: 萄 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/
{0x00,0x00,0x00,0x70,0x0E,0x70,0x3F,0xFE,0x06,0xC0,0x06,0x3C,0x1F,0xFC,0x1F,0xDC,
0x1F,0x9C,0x1B,0xFC,0x7F,0xFC,0x1B,0xFC,0x1F,0xDC,0x00,0x78,0x00,0x78,0x00,0x00},

/– 文字: 美 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/
{0x00,0x00,0x00,0xE0,0x06,0xF0,0x03,0xC0,0x01,0xF0,0x0F,0x80,0x07,0xE0,0x0F,0x80,
0x0F,0xFC,0x7B,0x80,0x3F,0xF8,0x03,0x80,0x07,0xE0,0x0E,0x70,0x3C,0x3E,0x00,0x00},

/– 文字: 酒 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/
{0x00,0x00,0x00,0x00,0x1C,0x1E,0x0F,0xFE,0x03,0xF0,0x71,0xFC,0x3F,0xFE,0x03,0xFC,
0x0F,0xBC,0x1B,0x8C,0x3B,0xFC,0x37,0x0C,0x77,0xFC,0x07,0x9C,0x00,0x0C,0x00,0x00},

/– 文字: 夜 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/
{0x00,0x00,0x03,0x80,0x01,0x80,0x00,0xFC,0x3F,0xC0,0x0C,0xC0,0x0E,0xF8,0x1D,0xF8,
0x1F,0xF0,0x3F,0x60,0x6D,0xE0,0xCD,0xE0,0x1F,0xF0,0x1E,0x3F,0x1C,0x00,0x00,0x00},

/– 文字: 光 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/
{0x00,0x00,0x00,0x00,0x03,0x80,0x01,0xB0,0x0D,0xF8,0x0F,0xE0,0x01,0xC0,0x03,0xF8,
0x3F,0xC0,0x07,0xC0,0x0E,0xC0,0x0C,0xC2,0x18,0xC7,0x30,0xCF,0x60,0x7E,0x00,0x00},

/– 文字: 杯 –/
/– 楷体12; 此字体下对应的点阵为:宽x高=16x16 –/

你可能感兴趣的:(技术,嵌入式,单片机)