1、网上搜集的 M12864-7A7 的程序,能正常显示,希望对大家有用,在此谢谢作者。#include #include #include #include “LCD_12864_data.h“#define Disp_on 0x3f /开显示#define Disp_off 0x3e /关显示#define Col_add 0x40 / 列起始地址#define Page_add 0xb8 /页起始地址#define Start_line 0xc0 /行起始地址#define lcd_bus P2 / MCU P0 LCMsbit di =P10; /指令数据 0 指令,1 数据 RSsbit
2、 rw =P11; /读写控制 sbit en =P12; /6800 mode Enable single Esbit cs1 =P36; /片选端 CS1 Mcssbit cs2 =P37; /片选端 CS2 Scsvoid delay(unsigned int t) /延时子程序unsigned int i,j;for(i=0;ichar code yan=0x02,0x22,0x72,0x2E,0xE2,0x00,0x04,0xE4,0x04,0x04,0xFC,0x42,0x42,0x42,0x00,0x00,0x40,0x23,0x14,0x08,0x17,0x20,0x20,0x
3、47,0x44,0x44,0x47,0x44,0x44,0x44,0x44,0x00/“延“,0;char code an=0x80,0x90,0x8C,0x84,0x84,0xF4,0xA5,0x86,0x84,0x84,0x84,0x84,0x94,0x8C,0x84,0x00,0x80,0x80,0x80,0x40,0x47,0x28,0x28,0x10,0x28,0x24,0x43,0xC0,0x40,0x00,0x00,0x00/“安“,1;char code da=0x20,0x20,0x20,0x20,0x20,0x20,0xA0,0x7F,0xA0,0x20,0x20,0x20
4、,0x20,0x20,0x20,0x00,0x00,0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x01,0x06,0x08,0x30,0x60,0xC0,0x40,0x00/“大“,2;char code xue=0x40,0x30,0x10,0x12,0x5C,0x54,0x50,0x51,0x5E,0xD4,0x50,0x18,0x57,0x32,0x10,0x00,0x00,0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x02,0x02,0x02,0x00/“学“,3;char code ce=
5、0x08,0x31,0x86,0x60,0x00,0xFE,0x02,0xF2,0x02,0xFE,0x00,0xF8,0x00,0x00,0xFF,0x00,0x04,0xFC,0x03,0x00,0x80,0x47,0x30,0x0F,0x10,0x67,0x00,0x07,0x40,0x80,0x7F,0x00/“测“,0;char code shi=0x40,0x42,0xDC,0x08,0x00,0x90,0x90,0x90,0x90,0x90,0xFF,0x10,0x12,0x1C,0x10,0x00,0x00,0x00,0x7F,0x20,0x10,0x20,0x20,0x1F,
6、0x10,0x10,0x01,0x06,0x18,0x20,0x78,0x00/“试“,0;char code wan=0x00,0x90,0x8C,0xA4,0xA4,0xA4,0xA5,0xA6,0xA4,0xA4,0xA4,0xA4,0x94,0x8C,0x04,0x00,0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x00,0x00,0x3F,0x40,0x40,0x40,0x70,0x00,0x00/“完“,0;char code bi=0x00,0x00,0xFF,0x88,0x48,0x28,0x08,0x80,0x7F,0x88,0x88,0x88,0x84,0x84,0xE0,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00/“毕“,0;