深圳市圣邦达电子有限公司
电话:086-0755-83723989 传真:086-0755-61351350
网 站 www.sbdsemi.cn EMAIL: yangbin7575@163.com
13543266942 13642365547
1.1.2. CPT 2.8” Initial Code
void ILI9320_CPT28_Initial(void)
{
// VCI=2.8V
//************* Reset LCD Driver ****************//
LCD_nRESET = 1;
delayms(1); // Delay 1ms
LCD_nRESET = 0;
delayms(10); // Delay 10ms
LCD_nRESET = 1;
delayms(50); // Delay 50 ms
//************* Start Initial Sequence **********//
LCD_CtrlWrite_ILI9320(0x00E5,0x8000);
LCD_CtrlWrite_ILI9320(0x0000,0x0001);
LCD_CtrlWrite_ILI9320(0x0001,0x0100);
LCD_CtrlWrite_ILI9320(0x0002,0x0700);
LCD_CtrlWrite_ILI9320(0x0003,0x1030);
LCD_CtrlWrite_ILI9320(0x0004,0x0000);
// Set the internal vcore voltage
// Start internal OSC.
// set SS and SM bit
// set 1 line inversion
// set GRAM write direction and BGR=1.
// Resize register
LCD_CtrlWrite_ILI9320(0x0008,0x0202);
LCD_CtrlWrite_ILI9320(0x0009, 0x0000);
LCD_CtrlWrite_ILI9320(0x000A, 0x0000);
LCD_CtrlWrite_ILI9320(0x000C, 0x0000);
LCD_CtrlWrite_ILI9320(0x000D, 0x0000);
LCD_CtrlWrite_ILI9320(0x000F, 0x0000);
// set the back porch and front porch
// set non-display area refresh cycle ISC[3:0]
// FMARK function
// RGB interface setting
// Frame marker Position
// RGB interface polarity
//*************Power On sequence ****************//
LCD_CtrlWrite_ILI9320(0x0010,0x0000);
LCD_CtrlWrite_ILI9320(0x0011, 0x0007);
LCD_CtrlWrite_ILI9320(0x0012, 0x0000);
LCD_CtrlWrite_ILI9320(0x0013,0x0000);
delayms(200);
// SAP, BT[3:0], AP, DSTB, SLP, STB
// DC1[2:0], DC0[2:0], VC[2:0]
// VREG1OUT voltage
// VDV[4:0] for VCOM amplitude
// Dis-charge capacitor power voltage
LCD_CtrlWrite_ILI9320(0x0010,0x17B0);
LCD_CtrlWrite_ILI9320(0x0011,0x0037);
delayms(50);
// SAP, BT[3:0], AP, DSTB, SLP, STB
// DC1[2:0], DC0[2:0], VC[2:0]
// Delay 50ms
LCD_CtrlWrite_ILI9320(0x0012,0x013A);
delayms(50);
// VREG1OUT voltage
// Delay 50ms
LCD_CtrlWrite_ILI9320(0x0013,0x1600);
LCD_CtrlWrite_ILI9320(0x0029,0x000C);
delayms(50);
// VDV[4:0] for VCOM amplitude
// VCM[4:0] for VCOMH
LCD_CtrlWrite_ILI9320(0x0020,0x0000);
LCD_CtrlWrite_ILI9320(0x0021,0x0000);
// GRAM horizontal Address
// GRAM Vertical Address
// ----------- Adjust the Gamma Curve ----------//
LCD_CtrlWrite_ILI9320(0x0030, 0x0504);
LCD_CtrlWrite_ILI9320(0x0031, 0x0703);
LCD_CtrlWrite_ILI9320(0x0032, 0x0702);
LCD_CtrlWrite_ILI9320(0x0035, 0x0101);
LCD_CtrlWrite_ILI9320(0x0036, 0x0A1F);
LCD_CtrlWrite_ILI9320(0x0037, 0x0504);
LCD_CtrlWrite_ILI9320(0x0038, 0x0003);
LCD_CtrlWrite_ILI9320(0x0039, 0x0706);
LCD_CtrlWrite_ILI9320(0x003C, 0x0707);
LCD_CtrlWrite_ILI9320(0x003D,0x091F);
圣邦达电子有限公司 电话 0755-83723989 81753210 传真 0755-61351350 www.sbdsemi.cn
Page 5 of 34
V0.9