《液晶4位并行接口驱动程序.doc》由会员分享,可在线阅读,更多相关《液晶4位并行接口驱动程序.doc(12页珍藏版)》请在金锄头文库上搜索。
1、#include#include#include#include#define uchar unsigned char #define uint unsigned int#define DATA 1#define COMMAND 0sbit rs=P24;sbit rw=P25;sbit en=P26;sbit psb=P21;sbit rst=P23;sbit key=P10;uchar code AC_TABLE=0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, /第一行汉字位置0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,
2、 /第二行汉字位置0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, /第三行汉字位置0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, /第四行汉字位置;uchar code str1=黄河远上白云间,一片孤城万仞山。羌笛何须怨杨柳,春风不度玉门关。;uchar code bmp1=/*/ / 位图点阵占用1024字节/*/0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x0F,0x80,0x00,0
3、x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x3F,0xC0,0x00,0x07,0x07,0x00,0x04,0x01,0x00,0x00,0x38,0x60,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0
4、x00,0x78,0xE0,0x00,0x3F,0x83,0x80,0x06,0x03,0x80,0x00,0x1C,0x70,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x02,0x38,0x70,0x00,0xFF,0x07,0x80,0x06,0x39,0x80,0x00,0x1F,0x70,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
5、x00,0x00,0x01,0x80,0x02,0x1C,0x30,0x00,0x7C,0x0E,0x00,0x06,0x19,0xC0,0x00,0x1F,0x80,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x02,0x1C,0x30,0x00,0x3E,0x1C,0x00,0x06,0x1F,0xC0,0x00,0x7F,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
6、x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0x3E,0x30,0x00,0x62,0x1A,0x00,0x0F,0x79,0x00,0x03,0xFE,0x00,0x00,0x01,0x80,0x00,0x00,0x60,0x0F,0x00,0x3F,0x00,0x00,0x00,0x3C,0x00,0xC0,0x00,0x00,0x01,0x80,0x07,0x76,0x18,0x00,0xC3,0xC1,0x00,0x1F,0xFB,0x00,0x03,0xFE,0x00,0x00,0x01,0x80,0x00,0x01,0xE0,0x3F,0
7、xC0,0xF1,0xC0,0x00,0x00,0xF0,0x01,0xC0,0x00,0x00,0x01,0x80,0x07,0x6E,0x18,0x00,0xCF,0xC1,0x80,0x7E,0x3F,0x80,0x01,0xE2,0x00,0x00,0x01,0x80,0x00,0x07,0xE0,0x7F,0xE0,0xE0,0xE0,0x00,0x03,0xC0,0x03,0xC0,0x00,0x00,0x01,0x80,0x07,0x7F,0x98,0x00,0xFE,0x83,0x81,0xFC,0x1E,0xC0,0x00,0x83,0x00,0x00,0x01,0x80,0
8、x00,0x0F,0xE0,0x63,0xE1,0xE0,0xE0,0x00,0x07,0x00,0x03,0xC0,0x00,0x00,0x01,0x80,0x06,0xFF,0xD8,0x01,0xFA,0x87,0x00,0xFD,0xF8,0xC0,0x01,0x73,0x00,0x00,0x01,0x80,0x00,0x01,0xE0,0xC1,0xE1,0xE0,0xE0,0x00,0x0F,0x00,0x07,0xC0,0x00,0x00,0x01,0x80,0x0F,0xD9,0xD8,0x03,0xE3,0x0E,0x80,0xFE,0x7E,0xC0,0x03,0xF9,0
9、x80,0x00,0x01,0x80,0x00,0x01,0xE0,0x01,0xE1,0xF0,0xE0,0x00,0x1E,0x00,0x0B,0xC0,0x00,0x00,0x01,0x80,0x0D,0xB8,0x18,0x1F,0xC3,0x08,0xC0,0x0E,0x6D,0x80,0x03,0xF1,0x80,0x00,0x01,0x80,0x00,0x01,0xE0,0x01,0xE0,0xFD,0xC7,0xEF,0x9E,0x00,0x13,0xC0,0x00,0x00,0x01,0x80,0x0D,0xFE,0x18,0x0F,0xC2,0x10,0xE0,0x1C,0
10、x3F,0x00,0x03,0xE0,0xC0,0x00,0x01,0x80,0x00,0x01,0xE0,0x01,0xC0,0xFF,0x83,0xC6,0x1F,0xE0,0x13,0xC0,0x00,0x00,0x01,0x80,0x0D,0xCE,0x18,0x06,0xC2,0x01,0xC0,0x38,0x3E,0x00,0x00,0xE8,0xC0,0x00,0x01,0x80,0x00,0x01,0xE0,0x01,0x80,0x3F,0x81,0xE4,0x3C,0x78,0x23,0xC0,0x00,0x00,0x01,0x80,0x0C,0x4C,0x18,0x00,0
11、xC2,0x03,0x80,0x78,0x1F,0xF0,0x00,0xFC,0x60,0x00,0x01,0x80,0x00,0x01,0xE0,0x03,0x80,0x3F,0xC1,0xE8,0x3C,0x78,0x43,0xC0,0x00,0x00,0x01,0x80,0x0C,0x5E,0x18,0x00,0xC2,0x07,0x00,0x68,0x3F,0xF8,0x03,0xFC,0x22,0x00,0x01,0x80,0x00,0x01,0xE0,0x03,0x00,0x6F,0xC0,0xF0,0x3C,0x3C,0x83,0xC0,0x00,0x00,0x01,0x80,0
12、x06,0x3F,0x38,0x01,0x82,0x0E,0x00,0x09,0xF8,0x00,0x03,0xC0,0x32,0x00,0x01,0x80,0x00,0x01,0xE0,0x06,0x00,0xC3,0xE0,0x78,0x3C,0x3C,0xFF,0xF0,0x00,0x00,0x01,0x80,0x07,0x10,0x38,0x00,0x82,0x1C,0x00,0x0B,0x99,0xC0,0x03,0x00,0x1A,0x00,0x01,0x80,0x00,0x01,0xE0,0x0C,0x11,0xC3,0xE0,0x78,0x3C,0x3C,0xFF,0xF0,0
13、x00,0x00,0x01,0x80,0x03,0xFF,0xF0,0x00,0x02,0x38,0x00,0x08,0x30,0xE0,0x02,0x00,0x1E,0x00,0x01,0x80,0x00,0x01,0xE0,0x08,0x11,0xC1,0xE0,0x7C,0x3C,0x3C,0xFF,0xF0,0x00,0x00,0x01,0x80,0x01,0xEF,0xF0,0x00,0x00,0xE0,0x00,0x08,0xE0,0x60,0x00,0x00,0x0E,0x00,0x01,0x80,0x00,0x01,0xE0,0x1F,0xF1,0xC1,0xE0,0xBC,0
14、x1C,0x3C,0x03,0xC0,0x00,0x00,0x01,0x80,0x00,0x03,0xE0,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x07,0x00,0x01,0x80,0x00,0x01,0xE0,0x3F,0xE1,0xC1,0xC0,0x9E,0x1E,0x38,0x03,0xC0,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x80,0x00,0x01,0xF0,0x7F,0
15、xE0,0xE3,0x83,0x1F,0x0E,0x70,0x03,0xC0,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x0F,0xFC,0xFF,0xE0,0x3F,0x07,0xDF,0x83,0xE0,0x03,0xC0,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,