你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

查看: 1834|回复: 1

2.4寸TFT液晶显示问题

[复制链接]

4

主题

12

回帖

0

蝴蝶豆

初级会员

最后登录
2020-9-5
发表于 2012-5-20 17:03:19 | 显示全部楼层 |阅读模式
为什么我的TFT液晶接5V的时候,会亮,但是程序写下去一点反应都没有啊,然后接3.3V会有反应,同学说那是TFT本来的颜色。也就是说颜色出不来,为甚呢?我把初始化程序贴上来,请各位大侠帮帮忙,紧急啊。。。。谢谢各位大虾了
void LCD_Init(void)
{     
    LCD_REST_H();
    delay_ms(10); 
 LCD_REST_L();
 delay_ms(10);
 LCD_REST_H();
 LCD_CS_H();
 LCD_RD_H();
 LCD_WR_H();
 delay_ms(5);
 LCD_CS_L();  //打开片选使能
 delay_ms(100);
//************* Start Initial Sequence **********//
 LCD_Write_COM(0x00E3);
 LCD_Write_DATA(0x3008); // set SRAM internal timing
 LCD_Write_COM(0x00E7);
 LCD_Write_DATA(0x0012);
 LCD_Write_COM(0x00EF);
 LCD_Write_DATA(0x1231); 
 LCD_Write_COM(0x0000);
 LCD_Write_DATA(0x0001);
// LCD_Write_COM(0x002b);
// LCD_Write_DATA(0x0010);
 LCD_Write_COM(0x0001);
 LCD_Write_DATA(0x0100); // set SS and SM bit
 LCD_Write_COM(0x0002);
 LCD_Write_DATA(0x0700); // set 1 line inversion
 LCD_Write_COM(0x0003);
 LCD_Write_DATA(0x1008); // set GRAM write direction and BGR=1.
 LCD_Write_COM(0x0004);
 LCD_Write_DATA(0x0000); // Resize register
 LCD_Write_COM(0x0008);
 LCD_Write_DATA(0x0404); // set the back porch and front porch
 LCD_Write_COM(0x0009);
 LCD_Write_DATA(0x0000); // set non-display area refresh cycle ISC[3:0]
 LCD_Write_COM(0x000A);
 LCD_Write_DATA(0x0000); // FMARK function
 LCD_Write_COM(0x000C);
  LCD_Write_DATA(0x0000); // RGB interface setting
 LCD_Write_COM(0x000D);
 LCD_Write_DATA(0x0000); // Frame marker Position
 LCD_Write_COM(0x000F);
  LCD_Write_DATA(0x0000); // RGB interface polarity
 //*************Power On sequence ****************//
 LCD_Write_COM(0x0010);
 LCD_Write_DATA(0x0080); // SAP, BT[3:0], AP, DSTB, SLP, STB
 LCD_Write_COM(0x0011);
 LCD_Write_DATA(0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
 LCD_Write_COM(0x0012);
 LCD_Write_DATA(0x0000); // VREG1OUT voltage
 LCD_Write_COM(0x0013);
 LCD_Write_DATA(0x0000); // VDV[4:0] for VCOM amplitude
 LCD_Write_COM(0x0007);
 LCD_Write_DATA(0x0001);
  delay_ms(50); // Dis-charge capacitor power voltage
 LCD_Write_COM(0x0010);
 LCD_Write_DATA(0x1590); // 1490//SAP, BT[3:0], AP, DSTB, SLP, STB
 LCD_Write_COM(0x0011);
 LCD_Write_DATA(0x0227); // DC1[2:0], DC0[2:0], VC[2:0]
 delay_ms(50); // Delay 50ms
 LCD_Write_COM(0x0012);
 LCD_Write_DATA(0x001f); //001C// Internal reference voltage= Vci;
 delay_ms(50); // Delay 50ms
 LCD_Write_COM(0x0013);
 LCD_Write_DATA(0x1500); //0x1000//1400   Set VDV[4:0] for VCOM amplitude  1A00
 LCD_Write_COM(0x0029);
  LCD_Write_DATA(0x0022); //0x0012 //001a  Set VCM[5:0] for VCOMH  //0x0025  0034
 LCD_Write_COM(0x002B);
 LCD_Write_DATA(0x000f); // Set Frame Rate   000C
 delay_ms(50); // Delay 50ms
 LCD_Write_COM(0x0020);
 LCD_Write_DATA(0x00ef); // GRAM horizontal Address
 LCD_Write_COM(0x0021);
 LCD_Write_DATA(0x013f); // GRAM Vertical Address
 // ----------- Adjust the Gamma Curve ----------//
 LCD_Write_COM(0x0030);
 LCD_Write_DATA(0x0101);
 LCD_Write_COM(0x0031);
 LCD_Write_DATA(0x0707);
 LCD_Write_COM(0x0032);
 LCD_Write_DATA(0x0505);
 LCD_Write_COM(0x0035);
 LCD_Write_DATA(0x0407);
 LCD_Write_COM(0x0036);
 LCD_Write_DATA(0x0102);//0207
 LCD_Write_COM(0x0037);
 LCD_Write_DATA(0x0102);//0306
 LCD_Write_COM(0x0038);
 LCD_Write_DATA(0x0202);//0102
 LCD_Write_COM(0x0039);
 LCD_Write_DATA(0x0106);//0707
 LCD_Write_COM(0x003C);
 LCD_Write_DATA(0x0202);//0702
 LCD_Write_COM(0x003D);
 LCD_Write_DATA(0x706);//1604
 
 //------------------ Set GRAM area ---------------//
 LCD_Write_COM(0x0050);
 LCD_Write_DATA(0x0000); // Horizontal GRAM Start Address
 LCD_Write_COM(0x0051);
 LCD_Write_DATA(0x00EF); // Horizontal GRAM End Address
 LCD_Write_COM(0x0052);
 LCD_Write_DATA(0x0000); // Vertical GRAM Start Address
 LCD_Write_COM(0x0053);
 LCD_Write_DATA(0x013F); // Vertical GRAM Start Address
 LCD_Write_COM(0x0060);
 LCD_Write_DATA(0xA700); // Gate Scan Line
 LCD_Write_COM(0x0061);
 LCD_Write_DATA(0x0001); // NDL,VLE, REV
 LCD_Write_COM(0x006A);
 LCD_Write_DATA(0x0000); // set scrolling line
 //-------------- Partial Display Control ---------//
 LCD_Write_COM(0x0080);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0081);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0082);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0083);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0084);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0085);
 LCD_Write_DATA(0x0000);
 //-------------- Panel Control -------------------//
 LCD_Write_COM(0x0090);
 LCD_Write_DATA(0x0010);
 LCD_Write_COM(0x0092);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0093);
 LCD_Write_DATA(0x0003);
 LCD_Write_COM(0x0095);
 LCD_Write_DATA(0x0110);
 LCD_Write_COM(0x0097);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0098);
 LCD_Write_DATA(0x0000);
 LCD_Write_COM(0x0007);
 LCD_Write_DATA(0x0173); // 262K color and display ON
// LCD_Write_COM(0x0022);
// LCD_CS_H();  //关闭片选使能
// LCD_CS_L();  //打开LCD片选使能
}
回复

使用道具 举报

4

主题

12

回帖

0

蝴蝶豆

初级会员

最后登录
2020-9-5
 楼主| 发表于 2012-5-20 17:21:03 | 显示全部楼层

回复:2.4寸TFT液晶显示问题

我的驱动芯片是ILI9325
回复 支持 反对

使用道具 举报

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32Cube扩展软件包
意法半导体边缘AI套件
ST - 理想汽车豪华SUV案例
ST意法半导体智能家居案例
STM32 ARM Cortex 32位微控制器
关注我们
st-img 微信公众号
st-img 手机版