//------------------------------------------------- // Shenzhen TOPWAY Technology Co.,Ltd. // LCD Module: LM13232A // Display Size: 132x32 // Driver/Controller: ST7565R // Interface: 68mode // by: GuoQ // Date: 2008-05-23 // note: 3x booster(hardware config) //------------------------------------------------- #include #include #include #define uchar unsigned char // 0~255 #define uint unsigned int // 0~65535 uchar ContrastLevel; // for contrast setting level //----------------------------------- // dispaly data (132x32) //----------------------------------- uchar code Logo[]={ 0x07,0x01,0x01,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x40,0x80,0x40,0x80, 0x40,0x80,0x40,0x80,0x40,0xA0,0x40,0xA0,0x40,0xA0,0x50,0xA0,0x50,0xA0,0x50,0xA8, 0x50,0xA8,0x50,0xA8,0x54,0xA8,0x54,0x28,0x14,0xAA,0x94,0xCA,0xC4,0xEA,0xE4,0xE2, 0xF5,0xF2,0xF9,0xFA,0xF9,0xF8,0xFD,0xFC,0xFD,0xFC,0xFD,0xFC,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00, 0x40,0x40,0xC0,0x40,0x40,0x40,0x40,0x00,0x00,0x80,0x80,0xA0,0xC0,0x80,0x80,0xC0, 0xA0,0x80,0x80,0x80,0x00,0x80,0x40,0x20,0xC0,0x00,0xE0,0x00,0xC0,0x00,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x41,0xA8,0x55,0xAA,0x55,0xAA, 0x55,0x2A,0x95,0xCA,0xE5,0xF2,0xF9,0xF8,0xFD,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11, 0x11,0xFF,0x09,0x15,0x08,0xFE,0x89,0x88,0x88,0xF8,0x00,0x00,0x04,0x05,0x06,0xF4, 0x57,0x54,0x54,0x57,0x54,0xF6,0x05,0x04,0x00,0x08,0xFC,0x02,0x85,0x75,0x15,0xF5, 0x45,0x9E,0x61,0x9F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0xA8,0x54,0x2A,0x95,0xCA, 0xE5,0xF2,0xF9,0xFC,0xFE,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x10,0xD0, 0x10,0x10,0x10,0x10,0x11,0xD1,0x90,0x10,0x90,0xD1,0x10,0x10,0x90,0xD1,0x10,0x10, 0x10,0x90,0x50,0x51,0x51,0x91,0x11,0x91,0x51,0x51,0x50,0x90,0x10,0x90,0x51,0x51, 0x50,0x90,0x10,0x90,0x51,0x50,0x50,0x90,0x11,0x10,0x90,0x50,0x90,0x10,0x10,0x10, 0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x80,0x80,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x20,0x14,0xCA,0xE1,0xF8, 0xFC,0xFF,0xFF,0xFB,0xFB,0xC3,0xFB,0xFB,0xFF,0xE7,0xDB,0xDB,0xDB,0xE7,0xFF,0xC3, 0xEB,0xEB,0xEB,0xF7,0xFF,0xE3,0xDF,0xEF,0xDF,0xE3,0xFF,0xCF,0xE7,0xEB,0xE7,0xCF, 0xFF,0xFB,0xF7,0xCF,0xF7,0xFB,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F, 0x40,0x40,0x40,0x5F,0x50,0x50,0x50,0x50,0x40,0x5F,0x40,0x43,0x40,0x5F,0x40,0x40, 0x50,0x5F,0x50,0x40,0x40,0x48,0x50,0x52,0x52,0x4D,0x40,0x50,0x58,0x54,0x52,0x51, 0x40,0x48,0x50,0x52,0x52,0x4D,0x40,0x50,0x58,0x54,0x52,0x51,0x40,0x5F,0x42,0x42, 0x42,0x5F,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xE0 }; //----------------------------------- // Delay Routine //----------------------------------- void delayms(uint m) // 12MHz Xtal, close to ms value { uint j; uint i; for(i=0; i0x00) { ContrastLevel--; } SdCmd(0x81); // E-Vol setting SdCmd(ContrastLevel); // (2byte command) } //----------------------------------- // Init LCD module //----------------------------------- void initLCDM(void) { _RST=1; // hardware reset LCD module _RST=0; delayms(1); _RST=1; delayms(100); ContrastLevel=0x18; // default Contrast Level SdCmd(0xaf); // display on SdCmd(0x40); // display start line=0 SdCmd(0xa0); // ADC=0 SdCmd(0xa6); // normal display SdCmd(0xa4); // Display all point = off SdCmd(0xa2); // LCD bias = 1/6 (duty=1/33) SdCmd(0xc8); // Common output mode select=reverse SdCmd(0x2f); // Power control = all on SdCmd(0x23); // RA/RB setting SdCmd(0xf8);SdCmd(0x00);// Booster Ratio Set= 2x,3x,4x (2byte command) SdCmd(0x81); // E-Vol setting SdCmd(ContrastLevel); // (2byte command) } //----------------------------------- // Main Program //----------------------------------- void main() { SP=0x60; EA = 0; // disable interrupts _CS1 = 1; _RST = 1; RS = 1; R_W = 0;//???????? E = 0;//???????? // SCLK = 1;//???????? // SID = 1;//???????? P_S = 1;//0=?????????????1=??????????? initLCDM(); WriteScreen(Logo); while(1) { } } //end of program