Proteus仿真图:汉字用取模软件取得地址程序:#includereg51.h#defineucharunsignedchar#defineuintunsignedintsbitwr=P2^0;sbitrd=P2^1;sbitce=P2^2;sbitcd=P2^3;sbitrst=P2^4;voiddelay(uintt);voidinit_12864();voidwrite_data(uchardat);voidwrite_cmd1(ucharcmd);voidwrite_cmd2(uchardat,ucharcmd);voidwrite_cmd3(uchardata1,uchardata2,ucharcmd);ucharread_status();voidcheck_status();voidclear_screen();voiddisplay_char(ucharx,uchary,ucharch);//注意汉字数组要加code放到外部存储器中,如果不加code则空间不够ucharcodeHZ0[6][32]={{/*--文字:华--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/0x11,0x00,0x11,0x10,0x21,0x20,0x61,0xC0,0xA3,0x00,0x2D,0x08,0x21,0x08,0x20,0xF8,0x22,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00,0x02,0x00},/*--文字:东--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x04,0x00,0x04,0x00,0x7F,0xF0,0x08,0x00,0x12,0x00,0x22,0x00,0x3F,0xE0,0x02,0x00,0x02,0x00,0x22,0x40,0x22,0x20,0x42,0x10,0x82,0x10,0x0E,0x00},/*--文字:交--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x04,0x00,0x02,0x00,0xFF,0xF8,0x00,0x00,0x10,0x40,0x20,0x20,0x40,0x10,0x10,0x40,0x08,0x80,0x05,0x00,0x02,0x00,0x05,0x00,0x18,0xC0,0xE0,0x38},/*--文字:通--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x47,0xF0,0x21,0x20,0x20,0xC0,0x07,0xF0,0x04,0x90,0xE4,0x90,0x27,0xF0,0x24,0x90,0x24,0x90,0x27,0xF0,0x24,0x90,0x24,0xB0,0x50,0x00,0x8F,0xF8},/*--文字:大--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x08,0x80,0x08,0x80,0x10,0x40,0x20,0x20,0xC0,0x18},/*--文字:学--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x24,0x20,0x12,0x40,0x00,0x80,0xFF,0xF8,0x80,0x08,0x80,0x08,0x3F,0xC0,0x00,0x80,0x03,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00,0x02,0x00,0x0E,0x00}};ucharcodeHZ1[4][32]={/*--文字:电--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x02,0x00,0x02,0x00,0x02,0x00,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x00,0x02,0x08,0x02,0x08,0x01,0xF8},/*--文字:气--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x20,0x00,0x20,0x00,0x3F,0xF8,0x40,0x00,0x9F,0xE0,0x00,0x00,0x7F,0xE0,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x28,0x00,0x18,0x00,0x08},/*--文字:学--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x24,0x20,0x12,0x40,0x00,0x80,0xFF,0xF8,0x80,0x08,0x80,0x08,0x3F,0xC0,0x00,0x80,0x03,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00,0x02,0x00,0x0E,0x00},/*--文字:院--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x00,0x80,0xF0,0x40,0x97,0xF8,0x94,0x08,0xA0,0x00,0xA3,0xF0,0x90,0x00,0x90,0x00,0x97,0xF8,0x91,0x20,0xE1,0x20,0x82,0x20,0x84,0x28,0x88,0x18}};ucharcodeHZ2[6][32]={{/*--文字:零--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/0x3F,0xE0,0x02,0x00,0xFF,0xF8,0x82,0x08,0xBA,0xE8,0x02,0x00,0x3A,0xE0,0x0D,0x80,0x30,0x60,0xC2,0x18,0x1F,0xC0,0x00,0x80,0x1D,0x00,0x03,0x00},/*--文字:七--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x78,0x07,0x80,0xFC,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x08,0x04,0x08,0x03,0xF8},/*--文字:电--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x02,0x00,0x02,0x00,0x02,0x00,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x00,0x02,0x08,0x02,0x08,0x01,0xF8},/*--文字:牵--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x02,0x00,0x3F,0xE0,0x05,0x00,0x08,0x80,0x10,0x40,0xFF,0xF8,0x80,0x08,0x22,0x00,0x3F,0xE0,0x42,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00},/*--文字:二--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x00,0x00,0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF8,0x00,0x00},/*--文字:班--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x01,0x00,0xF9,0x78,0x21,0x20,0x25,0x20,0x25,0x20,0xFD,0x20,0x25,0x78,0x25,0x20,0x29,0x20,0x21,0x20,0x3A,0x20,0xE2,0x20,0x04,0xF8,0x08,0x00}};ucharcodeHZ3[3][32]={{/*--文字:占--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/0x04,0x00,0x04,0x00,0x04,0x00,0x07,0xF8,0x04,0x00,0x04,0x00,0x04,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x7F,0xE0,0x40,0x20},/*--文字:俊--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x10,0x80,0x11,0x00,0x12,0x20,0x27,0xF0,0x20,0x10,0x62,0x20,0xA4,0x10,0x29,0x08,0x21,0xE0,0x22,0x20,0x25,0x40,0x20,0x80,0x23,0x60,0x2C,0x18},/*--文字:龙--*//*--楷体_GB231211;此字体下对应的点阵为:宽x高=14x14--*//*--宽度不是8的倍数,现调整为:宽度x高度=16x14--*/{0x04,0x00,0x04,0x80,0x04,0x40,0x04,0x00,0xFF,0xF8,0x05,0x00,0x09,0x10,0x09,0x20,0x09,0x40,0x11,0x80,0x11,0x00,0x23,0x08,0x4D,0x08,0x80,0xF8}};//汉字显示函数,处在xy处显示汉字hzvoiddisplay_HZ(ucharx,uchary,uchar*hz)////x0-3y0-7{uchari,j=0;for(i=0;i16;i++){write_cmd3(((j/2)4)|(y*2),x,0x24);//地址指针设置..低地址,高地