void LCD_Init(void) { //CS0=0; RST=1; Delay(200); RST=0; Delay(300); RST=1; Delay(200); WriteComm(0xff); WriteData(0xa5); WriteComm(0x41); WriteData(0x00); //00:3 SPI 01:2data line SPI WriteComm(0x43); WriteData(0x24);//34 WriteComm(0xF1); WriteData(0x0A); WriteComm(0x53); WriteData(0x06); WriteComm(0x54); WriteData(0x06); WriteComm(0x55); WriteData(0x17); WriteComm(0x56); WriteData(0x16); WriteComm(0x58); WriteData(0x02); WriteComm(0x11); //sleep out Delay( 120 ); //G0A WriteComm(0xA0); WriteData(0x08); WriteData(0x00); WriteComm(0xA1); WriteData(0x89); WriteComm(0xA2); WriteData(0x8a); WriteComm(0xA3); WriteData(0x87); WriteComm(0xA4); WriteData(0x88); WriteComm(0xA8); WriteData(0x03); WriteComm(0xAA); WriteData(0x90); WriteComm(0xB9); WriteData(0x81); WriteComm(0xBA); WriteData(0x82); WriteComm(0xBB); WriteData(0x01); WriteComm(0xBC); WriteData(0x00); WriteComm(0xBD); WriteData(0x85); WriteComm(0xBE); WriteData(0x86); WriteComm(0xBF); WriteData(0x83); WriteComm(0xC0); WriteData(0x84); WriteComm(0xC4); WriteData(0x03); WriteComm(0xC6); WriteData(0x90); WriteComm(0xC8); WriteData(0x55); WriteComm(0xC9); WriteData(0xef); WriteComm(0xCA); WriteData(0xee); WriteComm(0xCB); WriteData(0xf1); WriteComm(0xCC); WriteData(0xf0); WriteComm(0xCD); WriteData(0x55); WriteComm(0xCE); WriteData(0xEB); WriteComm(0xCF); WriteData(0xEA); WriteComm(0xD0); WriteData(0xED); WriteComm(0xD1); WriteData(0xEC); WriteComm(0xE6); WriteData(0x22); WriteComm(0xf2); WriteData(0x46); //0X44 WriteComm(0x3A); WriteData(0x05); //05: 565 06:666 WriteComm(0x80); WriteData(0x10); WriteComm(0x57); // IBIAS WriteData(0x01); // 01: 0.5 WriteComm(0x8f); //PUMP CLK SEL WriteData(0x14); WriteComm(0x35); WriteComm(0x46); WriteData(0x10); WriteComm(0xe9); WriteData(0x20); //a0:2 line inv 20:2dot inv WriteComm(0x83); // GVCL ADJ WriteData(0x4a); // GVCL -3.8 WriteComm(0x84); // GVDD ADJ WriteData(0xc0); // GVDD 5.9 c0 WriteComm(0x85); // GVSP ADJ ??? WriteData(0x32); WriteComm(0x9c); // vgh WriteData(0xa0); WriteComm(0x9d); // vgh WriteData(0x14); WriteComm(0x9e); // vgl WriteData(0xc7); //gamma2.2 WriteComm(0x60); //v63 vrp0[3:0] WriteData(0x00); WriteComm(0x61); //v62 vrp1[5:0] WriteData(0x10); WriteComm(0x62); //v61 WriteData(0x17); WriteComm(0x63); //v59 WriteData(0x0b); WriteComm(0x64); //v57 WriteData(0x08); WriteComm(0x65); //v50 WriteData(0x09); WriteComm(0x66); //v43 WriteData(0x39); WriteComm(0x67); //v36 WriteData(0x45); WriteComm(0x68); //v20 WriteData(0x4f); WriteComm(0x69); //v13 WriteData(0x08); WriteComm(0x6a); //v6 WriteData(0x1a); WriteComm(0x6b); //v4 WriteData(0x10); WriteComm(0x6c); //v2 WriteData(0x2f); WriteComm(0x6d); //v1 WriteData(0x36); WriteComm(0x6e); //v0 vrp63[3:0] WriteData(0x0f); WriteComm(0x6f); // WriteData(0x00); WriteComm(0x70); //v63 vrn0[3:0] WriteData(0x00); WriteComm(0x71); //v62 WriteData(0x10); WriteComm(0x72); //v61 WriteData(0x17); WriteComm(0x73); //v59 WriteData(0x09); WriteComm(0x74); //v57 WriteData(0x0a); WriteComm(0x75); //v50 WriteData(0x01); WriteComm(0x76); //v43 WriteData(0x41); WriteComm(0x77); //v36 WriteData(0x33); WriteComm(0x78); //v20 WriteData(0x52); WriteComm(0x79); //v13 WriteData(0x06); WriteComm(0x7a); //v6 WriteData(0x0c); WriteComm(0x7b); //v4 WriteData(0x13); WriteComm(0x7c); //v2 WriteData(0x30); WriteComm(0x7d); //v1 WriteData(0x36); WriteComm(0x7e); //v0 vrn63[3:0] WriteData(0x0f); WriteComm(0x36); WriteData(0x00);// WriteComm(0x29); // display on Delay( 200 ); }