/************************************/ /*WWW.TRUEVISION-TECH.COM**************/ /*P/N:TG9158A*********************/ /*IC:ST7567**********************/ /*Driving:1/65duty,1/9bias**********/ /************************************/ #include "REG51.h" #include "nop.h" sbit RS = P3^0; sbit CS = P3^2; sbit RES = P3^1; sbit RW = P3^1; sbit E = P3^0; sbit SCK = P1^0; sbit SDA = P1^1; sbit pause = P2^0; sbit set1 = P2^1;//contrast up sbit set2 = P2^2;//contrast down sbit set3 = P2^3;//internal resist ratio up sbit set4 = P2^4;//internal resist ratio down sbit set5 = P2^5; unsigned char vopcode,Ra_Rb,LCMSEG,LCMCOM,interface; void writec(unsigned char inst); /*write command */ void writed(unsigned char data1); /*write data */ void Initial(void); /*LCD initial */ void Decoder(unsigned char no); void address(unsigned char page); /*address */ void pic(unsigned char c1,unsigned char c2); /*delay function */ void picg(void); void WAIT_KEY(void); void delay_standard(unsigned int delaytime); void displaybout(unsigned char bout1,unsigned char bout2); void wdbit(unsigned char bit1,unsigned char xdree,unsigned char ydree); unsigned char *pt; unsigned char code gg1[]={ /*-- Width x height=128x64 --*/ 0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xC1,0x31,0xC1,0x01,0x01,0x01,0x01, 0x11,0xF1,0x11,0x11,0x11,0xE1,0x01,0x01,0xC1,0x21,0x11,0x11,0x11,0x21,0x71,0x01, 0x11,0xF1,0x11,0x11,0x11,0x11,0x21,0xC1,0x01,0x11,0xF1,0x11,0x11,0x91,0x31,0x01, 0x11,0xF1,0x11,0x11,0x91,0x31,0x01,0xC1,0x21,0x11,0x11,0x11,0x21,0x71,0x01,0x01, 0x11,0xF1,0x11,0x01,0x01,0x11,0xF1,0x11,0x01,0x11,0xF1,0x11,0x01,0x01,0x11,0xF1, 0x11,0x01,0x11,0xF1,0x11,0x81,0x41,0x31,0x11,0x11,0x01,0x11,0xF1,0x11,0x01,0x01, 0x01,0x01,0x11,0xF1,0x31,0xC1,0x01,0x01,0x01,0xC1,0x31,0xF1,0x11,0x01,0x11,0xF1, 0x41,0x81,0x01,0x11,0xF1,0x11,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x1C,0x13,0x02,0x02,0x13,0x1C,0x10,0x00, 0x10,0x1F,0x11,0x11,0x11,0x11,0x0E,0x00,0x07,0x08,0x10,0x10,0x10,0x08,0x04,0x00, 0x10,0x1F,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x10,0x1F,0x11,0x11,0x13,0x10,0x08, 0x10,0x1F,0x11,0x01,0x03,0x00,0x00,0x07,0x08,0x10,0x10,0x10,0x11,0x0F,0x01,0x00, 0x10,0x1F,0x11,0x01,0x01,0x11,0x1F,0x10,0x00,0x10,0x1F,0x10,0x00,0x18,0x10,0x0F, 0x00,0x00,0x10,0x1F,0x11,0x02,0x04,0x18,0x10,0x10,0x00,0x10,0x1F,0x10,0x10,0x10, 0x10,0x08,0x10,0x1F,0x10,0x00,0x07,0x18,0x07,0x00,0x10,0x1F,0x10,0x00,0x10,0x1F, 0x10,0x00,0x03,0x04,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x10,0x08,0x08,0x08,0x08,0x10,0xE0,0x00, 0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0xE0,0x10,0x08,0x08,0x08,0x08,0x10,0xE0,0x00, 0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x30,0x48,0x88,0x88,0x18,0x00,0x18,0x08, 0x08,0xF8,0x08,0x08,0x18,0x00,0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x08, 0x78,0x88,0x00,0x88,0x78,0x08,0x00,0x08,0x78,0x88,0x00,0x88,0x78,0x88,0x00,0xC8, 0x38,0x08,0x08,0x18,0x28,0x40,0xC0,0x28,0x18,0x08,0x00,0x08,0x18,0xE8,0x00,0xC0, 0x28,0x18,0x08,0x00,0x18,0x08,0xC8,0x28,0x18,0x08,0x00,0xF0,0x08,0x08,0x08,0xF0, 0x00,0x00,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x08,0x08,0x08,0x08,0x04,0x03,0x00, 0x08,0x0F,0x08,0x00,0x00,0x00,0x00,0x03,0x04,0x08,0x08,0x18,0x28,0x24,0x23,0x00, 0x08,0x0F,0x08,0x00,0x03,0x04,0x08,0x08,0x0C,0x08,0x08,0x08,0x07,0x00,0x00,0x00, 0x08,0x0F,0x08,0x00,0x00,0x00,0x00,0x07,0x08,0x08,0x08,0x08,0x07,0x00,0x00,0x00, 0x00,0x03,0x0C,0x03,0x00,0x00,0x00,0x00,0x00,0x03,0x0E,0x01,0x00,0x03,0x0E,0x01, 0x00,0x00,0x08,0x0C,0x0A,0x01,0x01,0x0A,0x0C,0x08,0x00,0x00,0x00,0x08,0x0F,0x08, 0x00,0x00,0x00,0x08,0x0E,0x09,0x08,0x08,0x08,0x0E,0x00,0x07,0x08,0x08,0x08,0x07, 0x00,0x00,0x08,0x0F,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x18,0x60,0x80,0x00,0x00,0x00, 0x08,0xF8,0x88,0x88,0x88,0xF0,0x00,0x00,0xE0,0x10,0x08,0x08,0x08,0x10,0x38,0x00, 0x08,0xF8,0x08,0x08,0x08,0x08,0x10,0xE0,0x00,0x08,0xF8,0x88,0x88,0xC8,0x18,0x00, 0x08,0xF8,0x88,0x88,0xC8,0x18,0x00,0xE0,0x10,0x08,0x08,0x08,0x90,0xB8,0x80,0x00, 0x08,0xF8,0x88,0x80,0x80,0x88,0xF8,0x08,0x00,0x08,0xF8,0x08,0x00,0x00,0x08,0xF8, 0x08,0x00,0x08,0xF8,0x88,0x40,0x20,0x18,0x08,0x08,0x00,0x08,0xF8,0x08,0x00,0x00, 0x00,0x00,0x08,0xF8,0x18,0x60,0x80,0x00,0x80,0x60,0x18,0xF8,0x08,0x00,0x08,0xF8, 0x20,0x40,0x80,0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x0E,0x09,0x01,0x01,0x09,0x0E,0x08,0x00, 0x08,0x0F,0x08,0x08,0x08,0x08,0x07,0x00,0x03,0x04,0x08,0x08,0x08,0x04,0x02,0x00, 0x08,0x0F,0x08,0x08,0x08,0x08,0x04,0x03,0x00,0x08,0x0F,0x08,0x08,0x09,0x08,0x04, 0x08,0x0F,0x08,0x00,0x01,0x00,0x00,0x03,0x04,0x08,0x08,0x08,0x08,0x07,0x00,0x00, 0x08,0x0F,0x08,0x00,0x00,0x08,0x0F,0x08,0x00,0x08,0x0F,0x08,0x00,0x0C,0x08,0x07, 0x00,0x00,0x08,0x0F,0x08,0x01,0x02,0x0C,0x08,0x08,0x00,0x08,0x0F,0x08,0x08,0x08, 0x08,0x04,0x08,0x0F,0x08,0x00,0x03,0x0C,0x03,0x00,0x08,0x0F,0x08,0x00,0x08,0x0F, 0x08,0x00,0x01,0x02,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x08,0x04,0x04,0x04,0x04,0x08,0xF0,0x00, 0x04,0xFC,0x44,0x44,0x44,0x38,0x00,0xF0,0x08,0x04,0x04,0x04,0x04,0x08,0xF0,0x00, 0x04,0xFC,0x44,0x44,0xC4,0x38,0x00,0x00,0x18,0x24,0x44,0x44,0x8C,0x00,0x0C,0x04, 0x04,0xFC,0x04,0x04,0x0C,0x00,0x04,0xFC,0x04,0x00,0x00,0x04,0xFC,0x04,0x00,0x04, 0x3C,0xC4,0x00,0xC4,0x3C,0x04,0x00,0x04,0x3C,0xC4,0x00,0xC4,0x3C,0xC4,0x00,0xE4, 0x1C,0x04,0x04,0x0C,0x14,0xA0,0xE0,0x14,0x0C,0x04,0x00,0x04,0x0C,0x74,0x80,0x60, 0x14,0x0C,0x04,0x00,0x0C,0x84,0x64,0x14,0x0C,0x04,0x00,0xF8,0x04,0x04,0x04,0xF8, 0x00,0x00,0x08,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x82,0x84,0x84,0x84,0x84,0x82,0x81,0x80, 0x84,0x87,0x84,0x80,0x80,0x80,0x80,0x81,0x82,0x84,0x84,0x8C,0x94,0x92,0x91,0x80, 0x84,0x87,0x84,0x80,0x81,0x82,0x84,0x84,0x86,0x84,0x84,0x84,0x83,0x80,0x80,0x80, 0x84,0x87,0x84,0x80,0x80,0x80,0x80,0x83,0x84,0x84,0x84,0x84,0x83,0x80,0x80,0x80, 0x80,0x81,0x86,0x81,0x80,0x80,0x80,0x80,0x80,0x81,0x87,0x80,0x80,0x81,0x87,0x80, 0x80,0x80,0x84,0x86,0x85,0x80,0x80,0x85,0x86,0x84,0x80,0x80,0x80,0x84,0x87,0x84, 0x80,0x80,0x80,0x84,0x87,0x84,0x84,0x84,0x84,0x87,0x80,0x83,0x84,0x84,0x84,0x83, 0x80,0x80,0x84,0x87,0x84,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF }; unsigned char code gg2[]={ /*-- Width x height=128x64 --*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xF8,0xF8,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0xF8,0xF8,0xF8,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0xF8,0xF8,0xF8,0x00,0x00, 0x00,0x00,0x00,0xF8,0xF8,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8, 0xF8,0xF8,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xF0,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00, 0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00, 0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00, 0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0xFC,0xFC,0xFC, 0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0, 0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00, 0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00, 0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, 0x00,0xFE,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00, 0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1, 0xF1,0xF1,0x00,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00, 0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00, 0x00,0x00,0x00,0xF1,0xF1,0xF1,0xF1,0xF1,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0xF8, 0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00 }; unsigned char code tab2[]= { /*-- character: 0 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00, /*-- character: 1 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00, /*-- character: 2 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00, /*-- character: 3 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00, /*-- character: 4 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00, /*-- character: 5 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00, /*-- character: 6 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00, /*-- character: 7 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00, /*-- character: 8 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00, /*-- character: 9 --*/ /*-- Simsun Font-1803012; Width x height=8x16 --*/ 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00, }; void wdbit(unsigned char bit1,unsigned char xdree,unsigned char ydree)//write a number¡¡£¸£ª£±£¶£» //bit1: point to 8*16 code£»xdree:point to £Ø address£» { unsigned char data i,xdreea,xdreeb; //Computational code£º unsigned char *ptt; bit1=bit1*16; ptt=tab2;ptt=ptt+bit1; xdreeb=xdree&0x0f;//single digit xdreea=xdree&0xf0;//tens digit xdreea=xdreea>>4;//Moves to the right of four //********************************** writec(0x40); writec(0xb0+ydree);//write page address writec(0x10+xdreea);//write seg address writec(0x00+xdreeb);//write seg address for(i=0;i<8;i++) writed(*ptt++); ydree++; writec(0xb0+ydree);//write page address writec(0x10+xdreea);//write seg address writec(0x00+xdreeb);//write seg address for(i=0;i<8;i++) writed(*ptt++); } void displaybout(unsigned char bout1,unsigned char bout2) /**********bout2:contrast*********************************/ /**********bout1:RA+RB*********************************/ { unsigned char bouta,boutb; bouta=bout1/16;//take RA+RB single(hexadecimal) boutb=bout1%16;//take RA+RB tens wdbit(bouta, 20,4);//display RA+RB tens wdbit(boutb, 28,4);//display RA+RB single bouta=bout2/10;//take contrast tens(decimalism) boutb=bout2%10;//take contrast single wdbit(bouta, 90,4);//displaycontrast tens wdbit(boutb, 98,4);//displaycontrast single } /********************************/ unsigned char key1(void) { set1=1;set2=1;///contrast set3=1;set4=1;///RA+RB /***********************************************/ if(set1==0) {delay_standard(100);//delay stabilization if(set1==0) { for(;set1==0;);//pause for key release return(1);//VOP calibration up; } else return(0); } /***********************************************/ else if(set2==0) {delay_standard(100);//delay stabilization if(set2==0) { for(;set2==0;);//pause for key release return(2);//VOP calibration down; } else return(0); } /***********************************************/ if(set3==0) {delay_standard(100);//delaystabilization if(set3==0) { for(;set3==0;);//pause for key release return(3);//RA+RB up; } else return(0); } /***********************************************/ else if(set4==0) {delay_standard(100);//delaystabilization if(set4==0) { for(;set4==0;);//pause for key release return(4);//RA+RB down; } else return(0); } else return(0); } /******************************* PAUSE /******************************/ void PAUSE(void) /****************************** VOP UP£¬VOP DOWN£¬OTPProgramming key is only effective under the condition of the suspension. ******************************/ { unsigned char kkkk; kkkk=key1();//When suspended under the condition of the keyboard scan***/ /***********************************************/ if(kkkk!=0) { if(kkkk==1){//VOP Calibration UP key if(vopcode==0x3f)vopcode--;//VOP limit vopcode++; writec(0x81); /* set Vop */ writec(vopcode); /* set EVR */ } /***********************************************/ else if(kkkk==2){//VOP Calibration DOWN key if(vopcode==0x00)vopcode++;//VOP limit vopcode--; writec(0x81);writec(vopcode); } /***********************************************/ else if(kkkk==3){//Ra+RB Calibration UP key if(Ra_Rb==0x27)Ra_Rb--;//Ra+RB limit Ra_Rb++; writec(Ra_Rb); /* set Vop */ } /***********************************************/ else if(kkkk==4){//VOP Calibration DOWN key if(Ra_Rb==0x20)Ra_Rb++;//Ra+RB limit Ra_Rb--; writec(Ra_Rb); /* set Vop */ } /***********************************************/ displaybout(Ra_Rb,vopcode); } } void delay_standard(unsigned int delaytime) { while(delaytime-->0); } void WAIT_KEY(void) { P2=0xff; while(P2&0x01)PAUSE(); delay_standard(10000);/*stabilization***/ P2=0xff; while((P2&0x01)==0x00);/*delay0.1S*/ delay_standard(10000); } void delay_1S(void) { delay_standard(20000);delay_standard(20000); delay_standard(20000);delay_standard(20000); delay_standard(25000);//delay_standard(60000); } void picg11(void) { unsigned char i,j; for(i=0;i<8;i++) { address(i); for(j=0;j<128;j++)writed(*pt++); } } unsigned char code ICONON[]={ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, //16 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, //16 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, //16 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, }; unsigned char code ICONOFF[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; unsigned char code ICON1[]={ 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //S1----16 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//17------32 0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//33-48 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//49-64 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//65-80 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//81-96 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,//97-112 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//113-128 }; unsigned char code ICON2[]={ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, //S1----16 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//17------32 0xff,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//33-48 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//49-64 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,//65-80 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//81-96 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0xff,0xff,//97-112 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//113-128 }; void ICON(void) { unsigned char j; address(8); for(j=0;j