RST=1; Delay_ms(10); RST=0; Delay_ms(200); RST=1; Delay_ms(120); WriteCom(0xff); WriteData(0xa5); WriteCom(0x3a); WriteData(0x65); WriteCom(0x51); WriteData(0x14); WriteCom(0x53); WriteData(0x11); WriteCom(0x62);//HFP WriteData(0x10); WriteCom(0x86); WriteData(0x00);//frc_en 01 WriteCom(0x87); WriteData(0x1e);//4.7 gvdd WriteCom(0x88); WriteData(0x0e);//vcomh0 WriteCom(0x89); WriteData(0x18);//vcoml WriteCom(0x61); //HBP WriteData(0x10); WriteCom(0x93); WriteData(0x12); WriteCom(0x94); WriteData(0x10); WriteCom(0x95); WriteData(0x10); WriteCom(0x96); WriteData(0x0e); WriteCom(0xb2); WriteData(0x0F); WriteCom(0xb4); WriteData(0x60); WriteCom(0x91); WriteData(0x10); WriteCom(0xC1); WriteData(0xF1); WriteCom(0xC5); WriteData(0xF8); WriteCom(0xb5); WriteData(0x00); WriteCom(0xc3); WriteData(0x01);//ss/gs WriteCom(0x83); WriteData(0x10); //////////////////////gamma_set////////////////////////////////////// WriteCom(0x2a); WriteData(0x00); WriteData(0x84); WriteData(0x00); WriteData(0x84); WriteCom(0x2b); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x1f); WriteCom(0x2c); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x12);//VPMIDP 15 WriteData(0x00); WriteData(0x0e);//VRP1 10 WriteData(0x00); WriteData(0x1a);//VRP0 21 WriteData(0x00); WriteData(0x05);//KP7 0 WriteData(0x00); WriteData(0x0D);//KP6 1 WriteData(0x00); WriteData(0x0f);//KP5 2 WriteData(0x00); WriteData(0x0c);//KP4 6 WriteData(0x00); WriteData(0x1d);//KP3 25 WriteData(0x00); WriteData(0x16);//KP2 29 WriteData(0x00); WriteData(0x18);//KP1 30 WriteData(0x00); WriteData(0x1e);//KP0 31 WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(31-0x15);//VPMIDN 15 WriteData(0x00); WriteData(31-0x1a); //VRN0 21 WriteData(0x00); WriteData(31-0x0e);//VRN1 10 WriteData(0x00); WriteData(31-0x1e);//KN0 31 WriteData(0x00); WriteData(31-0x17);//KN1 30 WriteData(0x00); WriteData(31-0x15);//KN2 29 WriteData(0x00); WriteData(31-0x1f);//KN3 25 WriteData(0x00); WriteData(31-0x0e);//KN4 6 WriteData(0x00); WriteData(31-0x0f);//KN5 2 WriteData(0X00); WriteData(31-0x11);//KN6 1 WriteData(0x00); WriteData(31-0x05);//KN7 0 WriteCom(0x2a); // Set col address WriteData(0); // Start col address WriteData(0); WriteData(0); WriteData(127); // End col address WriteCom(0x2b); // Set page address WriteData(0); // Start col address WriteData(0); WriteData(0); WriteData(159); //159 End col address WriteCom(0x83); WriteData(0x00); WriteCom(0xff); WriteData(0x00); WriteCom(0x11); Delay_ms(120); WriteCom(0x3a); WriteData(0x55); WriteCom(0x36); WriteData(0x00); WriteCom(0x29); Delayms(10); WriteCom(0x2A); //Set Column Address WriteData(0x00); WriteData(0x10); WriteData(0x00); WriteData(0x6f); WriteCom(0x2B); //Set Page Address WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0x9f); WriteCom(0x2c);