OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 14908|回复: 0

开发板又多支持一种液晶驱动IC了-ILI9331

[复制链接]

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165354
金钱
165354
注册时间
2010-12-1
在线时间
2109 小时
发表于 2011-3-26 00:41:54 | 显示全部楼层 |阅读模式

 刚刚调试出来,现在可以支持ILI9331驱动IC的液晶屏了.目前ALIENTEK STM32开发板所实际测试可以支持的液晶IC型号有:9320,9325,9328,9331,5408,1505,1289,4531.总共8款之多!
大家只要把下面的初始化代码加入到液晶初始化函数里面,就可以支持9331的液晶了.

else if(DeviceCode==0X9331)   
 {
  LCD_WriteReg(0x00E7, 0x1014);
  LCD_WriteReg(0x0001, 0x0100); // set SS and SM bit
  LCD_WriteReg(0x0002, 0x0200); // set 1 line inversion
        LCD_WriteReg(0x0003,(1<<12)|(3<<4)|(0<<3));//65K   
  //LCD_WriteReg(0x0003, 0x1030); // set GRAM write direction and BGR=1.
  LCD_WriteReg(0x0008, 0x0202); // set the back porch and front porch
  LCD_WriteReg(0x0009, 0x0000); // set non-display area refresh cycle ISC[3:0]
  LCD_WriteReg(0x000A, 0x0000); // FMARK function
  LCD_WriteReg(0x000C, 0x0000); // RGB interface setting
  LCD_WriteReg(0x000D, 0x0000); // Frame marker Position
  LCD_WriteReg(0x000F, 0x0000); // RGB interface polarity
  //*************Power On sequence ****************//
  LCD_WriteReg(0x0010, 0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB
  LCD_WriteReg(0x0011, 0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
  LCD_WriteReg(0x0012, 0x0000); // VREG1OUT voltage
  LCD_WriteReg(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
  delay_ms(200); // Dis-charge capacitor power voltage
  LCD_WriteReg(0x0010, 0x1690); // SAP, BT[3:0], AP, DSTB, SLP, STB
  LCD_WriteReg(0x0011, 0x0227); // DC1[2:0], DC0[2:0], VC[2:0]
  delay_ms(50); // Delay 50ms
  LCD_WriteReg(0x0012, 0x000C); // Internal reference voltage= Vci;
  delay_ms(50); // Delay 50ms
  LCD_WriteReg(0x0013, 0x0800); // Set VDV[4:0] for VCOM amplitude
  LCD_WriteReg(0x0029, 0x0011); // Set VCM[5:0] for VCOMH
  LCD_WriteReg(0x002B, 0x000B); // Set Frame Rate
  delay_ms(50); // Delay 50ms
  LCD_WriteReg(0x0020, 0x0000); // GRAM horizontal Address
  LCD_WriteReg(0x0021, 0x013f); // GRAM Vertical Address
  // ----------- Adjust the Gamma Curve ----------//
  LCD_WriteReg(0x0030, 0x0000);
  LCD_WriteReg(0x0031, 0x0106);
  LCD_WriteReg(0x0032, 0x0000);
  LCD_WriteReg(0x0035, 0x0204);
  LCD_WriteReg(0x0036, 0x160A);
  LCD_WriteReg(0x0037, 0x0707);
  LCD_WriteReg(0x0038, 0x0106);
  LCD_WriteReg(0x0039, 0x0707);
  LCD_WriteReg(0x003C, 0x0402);
  LCD_WriteReg(0x003D, 0x0C0F);
  //------------------ Set GRAM area ---------------//
  LCD_WriteReg(0x0050, 0x0000); // Horizontal GRAM Start Address
  LCD_WriteReg(0x0051, 0x00EF); // Horizontal GRAM End Address
  LCD_WriteReg(0x0052, 0x0000); // Vertical GRAM Start Address
  LCD_WriteReg(0x0053, 0x013F); // Vertical GRAM Start Address
  LCD_WriteReg(0x0060, 0x2700); // Gate Scan Line
  LCD_WriteReg(0x0061, 0x0001); // NDL,VLE, REV
  LCD_WriteReg(0x006A, 0x0000); // set scrolling line
  //-------------- Partial Display Control ---------//
  LCD_WriteReg(0x0080, 0x0000);
  LCD_WriteReg(0x0081, 0x0000);
  LCD_WriteReg(0x0082, 0x0000);
  LCD_WriteReg(0x0083, 0x0000);
  LCD_WriteReg(0x0084, 0x0000);
  LCD_WriteReg(0x0085, 0x0000);
  //-------------- Panel Control -------------------//
  LCD_WriteReg(0x0090, 0x0010);
  LCD_WriteReg(0x0092, 0x0600);
  LCD_WriteReg(0x0007, 0x0133); // 262K color and display ON
 }

我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-28 06:28

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表