深圳市圣邦达电子有限公司
电话:086-0755-83723989 传真:086-0755-61351350
网 站 www.sbdsemi.cn
EMAIL : yangbin7575@163.com
联系人:杨 生 13543266942 13642365547
1.2.1. CPT 3.2” Initial Code
void ILI9320_CPT32_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);
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 internal vcore voltage
// Start internal OSC.
// set SS and SM bit
// set 1 line inversion
// set GRAM write direction and BGR=1.
// Resize register
// 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
// SAP, BT[3:0], AP, DSTB, SLP, STB
// DC1[2:0], DC0[2:0], VC[2:0]
LCD_CtrlWrite_ILI9320(0x0010, 0x17B0);
LCD_CtrlWrite_ILI9320(0x0011, 0x0147);
delayms(50);
// Delay 50ms
LCD_CtrlWrite_ILI9320(0x0012, 0x013C);
// VREG1OUT voltage
delayms(50);
// Delay 50ms
LCD_CtrlWrite_ILI9320(0x0013, 0x0E00);
LCD_CtrlWrite_ILI9320(0x0029, 0x0009);
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, 0x0207);
LCD_CtrlWrite_ILI9320(0x0031, 0x0505);
LCD_CtrlWrite_ILI9320(0x0032, 0x0102);
LCD_CtrlWrite_ILI9320(0x0035, 0x0006);
LCD_CtrlWrite_ILI9320(0x0036, 0x0606);
LCD_CtrlWrite_ILI9320(0x0037, 0x0707);
LCD_CtrlWrite_ILI9320(0x0038, 0x0506);
LCD_CtrlWrite_ILI9320(0x0039, 0x0407);
LCD_CtrlWrite_ILI9320(0x003C, 0x0106);
LCD_CtrlWrite_ILI9320(0x003D, 0x0601);
//------------------ Set GRAM area ---------------//
LCD_CtrlWrite_ILI9320(0x0050, 0x0000);
LCD_CtrlWrite_ILI9320(0x0051, 0x00EF);
LCD_CtrlWrite_ILI9320(0x0052, 0x0000);
// Horizontal GRAM Start Address
// Horizontal GRAM End Address
// Vertical GRAM Start Address
圣邦达电子有限公司 电话 0755-83723989 81753210 传真 0755-61351350 www.sbdsemi.cn
Page 8 of 34
V0.9