//--------------------------------------------------------- // Shenzhen TOPWAY Technology Co.,Ltd. // LCD Module: LM6060c // Display Size: 128x64 // Driver/Controller: ST7565P // Interface: 80 mode // by: DongQ // Date: 2014-01-6 // Note: 1.Modify booster multiple f801(5x)->f800(4x) // 2.Add set internal Rb/Ra = 5.5V for lcd(G-mode) //--------------------------------------------------------- #include #include #include #define uchar unsigned char // 0~255 #define uint unsigned int // 0~65535 #define LCDBus P1 sbit _CS1 = P3^4; sbit _RES = P3^5; sbit RS = P3^6; sbit _WR = P3^7; sbit _RD = P3^3; uchar ContrastLevel; // for contrast setting level //----------------------------------- // dispaly data (128x64) //----------------------------------- uchar code Logo[]={ /*-- ????????????D:\guoq files\technic support\pic\LM6060C-LOGO-128x64.bmp --*/ /*-- ????x???=128x64 --*/ 0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x7F,0x7F,0x7F,0x7F,0x7D,0x7D, 0x41,0x7D,0x7D,0x7F,0x63,0x5D,0x5D,0x5D,0x63,0x7F,0x41,0x75,0x75,0x75,0x7B,0x7F, 0x61,0x5F,0x6F,0x5F,0x61,0x7F,0x47,0x6B,0x6D,0x6B,0x47,0x7F,0x7D,0x7B,0x47,0x7B, 0x7D,0x7F,0x7F,0x7F,0x7F,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x40,0x88,0x10,0x00,0x30,0x90,0x50,0x90,0x10,0x50,0x90,0x30,0x00, 0x80,0x80,0xF8,0x80,0x80,0xF8,0x00,0x00,0xF0,0x00,0x00,0xF8,0x00,0x40,0x40,0xF8, 0x40,0x40,0x10,0x90,0x70,0x10,0x10,0x10,0x10,0x00,0x00,0x60,0xA0,0x28,0xF0,0x20, 0x20,0xF0,0x28,0xA0,0x60,0x20,0x00,0x20,0x10,0x88,0x70,0x40,0x78,0x40,0x70,0x80, 0x78,0xC0,0x40,0x00,0x80,0x90,0x90,0xF0,0x88,0x80,0x20,0x40,0x00,0xF8,0x00,0x00, 0x00,0x40,0x40,0xF8,0x40,0x00,0x40,0x40,0x40,0xF8,0x40,0x40,0x40,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x08,0x7C,0x02,0x20,0x22,0x12,0x0A,0x7F,0x0A,0x12,0x22,0x22,0x00, 0x10,0x30,0x1F,0x48,0x28,0x1F,0x00,0x00,0x1F,0x00,0x00,0x7F,0x00,0x04,0x44,0x7F, 0x02,0x05,0x02,0x7F,0x22,0x22,0x22,0x7E,0x00,0x00,0x01,0x01,0x01,0x7D,0x55,0x55, 0x55,0x55,0x55,0x7D,0x01,0x01,0x00,0x02,0x7F,0x40,0x21,0x1D,0x05,0x3D,0x51,0x27, 0x18,0x27,0x40,0x00,0x08,0x04,0x02,0x7F,0x02,0x0C,0x09,0x0A,0x08,0x7F,0x04,0x04, 0x00,0x04,0x42,0x7F,0x01,0x40,0x40,0x47,0x29,0x11,0x29,0x47,0x40,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xF8,0x08,0x08,0x08,0x08,0x08,0xE8,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0xE8,0x08,0x08,0x08,0x08,0x08,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,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,0x7D,0x45,0x45,0x45,0x45,0x45,0x7D,0x00,0x00,0x00,0x00,0xFE,0x80,0x80,0x80, 0x80,0x00,0xFE,0x04,0x08,0x04,0xFE,0x00,0x7C,0x92,0x92,0x92,0x64,0x00,0x7C,0x82, 0x82,0x82,0x7C,0x00,0x7C,0x92,0x92,0x92,0x64,0x00,0x7C,0x82,0x82,0x82,0x7C,0x00, 0x7C,0x82,0x82,0x82,0x44,0x00,0x00,0x00,0x00,0x7D,0x45,0x45,0x45,0x45,0x45,0x7D, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x3F,0x21,0x21,0x21,0x21,0x21,0x2F,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x2F,0x21,0x21,0x21,0x21,0x21,0x3F, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x80,0x00, 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x80, 0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, 0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x80,0x93,0xA4,0xA4,0xA4,0x99,0x80,0x80,0x80,0xBF,0x80,0x80,0x80,0xBF,0x82, 0x84,0x88,0xBF,0x80,0x80,0x80,0x80,0x80,0x80,0xBF,0xA0,0xA0,0xA0,0xA0,0x80,0x9F, 0xA0,0xA0,0xA0,0x91,0x80,0xBF,0xA0,0xA0,0x91,0x8E,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0xA1,0xBF,0xA0,0x80,0x80,0xA1,0xB0,0xA8,0xA4,0xA3,0x80,0x9B,0xA4, 0xA4,0xA4,0x9B,0x80,0xA2,0x94,0x88,0x94,0xA2,0x80,0x9F,0xA4,0xA4,0xA4,0x98,0x80, 0x8C,0x8A,0x89,0xBF,0x88,0x80,0x80,0x80,0x80,0x80,0x80,0xBE,0x8A,0x8A,0x8A,0x84, 0x80,0x80,0xA2,0xBE,0xA0,0x80,0x80,0xA2,0x94,0x88,0x94,0xA2,0x80,0x9C,0xAA,0xAA, 0xAA,0x8C,0x80,0x80,0xA0,0xBF,0xA0,0x80,0x80,0xA4,0xAA,0xAA,0xAA,0x90,0x80,0xFF }; //----------------------------------- // Delay Routine //----------------------------------- void delayms(uint m) // 12MHz Xtal, close to ms value { uint j; uint i; for(i=0; if800***********/ SdCmd(0xf8); // Booster Ratio = 4x SdCmd(0x00); // (two byte command) /********************************************************************/ SdCmd(0x81); // E-Vol setting SdCmd(ContrastLevel); // (2byte command) } //----------------------------------- // Main Program //----------------------------------- void main() { SP=0x60; EA = 0; // disable interrupts _CS1 = 1; _RES = 1; RS = 1; _WR = 1; _RD = 1; initLCDM(); WriteScreen(Logo); while(1) { } } //end of program