OpenEdv-开源电子网

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

ili9328液晶驱动问题

[复制链接]

3

主题

5

帖子

0

精华

新手上路

积分
38
金钱
38
注册时间
2013-4-30
在线时间
0 小时
发表于 2013-5-2 23:56:51 | 显示全部楼层 |阅读模式

         正点原子老师初始化里有一句话(我加了注释):

LCD_WriteReg(0x03,0x1030);

/*system 16-bit interface (1 transfers/pixel) 65,536 colors

    BGR=”1”: Swap the RGB data to BGR in writing into GRAM

    AM=0,I/D[1:0]=11

*/

为神马要把液晶RGB反过来?好奇怪,有木有?

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2013-5-3 11:01:13 | 显示全部楼层
回复【楼主位】auducy:
---------------------------------
和你的显示设置有关。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

3

主题

5

帖子

0

精华

新手上路

积分
38
金钱
38
注册时间
2013-4-30
在线时间
0 小时
 楼主| 发表于 2013-5-3 23:16:53 | 显示全部楼层
回复【2楼】正点原子:
---------------------------------
是哪些设置影响了呢?我没有找到哈,我把初始化的程序都贴上了:
void LCD_Init(void)

  RCC->APB2ENR|=1<<3;//先使能外设PORTB时钟
  RCC->APB2ENR|=1<<4;//先使能外设PORTC时钟

RCC->APB2ENR|=1<<0;    //开启辅助时钟 Alternate function I/O clock enable
JTAG_Set(SWD_ENABLE);  //开启SWD
 
//PORTC6~10推挽输出 C10为LCD背光控制
GPIOC->CRH&=0XFFFFF000;
GPIOC->CRH|=0X00000333; 
GPIOC->CRL&=0X00FFFFFF;
GPIOC->CRL|=0X33000000;  
GPIOC->ODR|=0X07C0;  //PC6~PC10 High  
//PORTB 16-bit推挽输出 
GPIOB->CRH=0X33333333;
GPIOB->CRL=0X33333333;   
GPIOB->ODR=0XFFFF;  //16-bit High
    
delay_ms(50); // delay 50 ms 
LCD_WriteReg(0x0000,0x0001);//start Osc
delay_ms(50); // delay 50 ms 
DeviceCode = LCD_ReadAddress(0x0000);   
    if(DeviceCode==0x9325||DeviceCode==0x9328)
{
LCD_WriteReg(0x00,0x0001);  
LCD_WriteReg(0x01,0x0000); //SS = 0,the shift direction of outputs is from S1 to S720;SM=0,Driver Output Contral.
LCD_WriteReg(0x02,0x0700); //LCD Driver Waveform Contral.
LCD_WriteReg(0x03,0x1030);
/*system 16-bit interface (1 transfers/pixel) 65,536 colors
  BGR=”1”: Swap the RGB data to BGR in writing into GRAM
  AM=0,I/D[1:0]=11
*/

LCD_WriteReg(0x04,0x0000); //Scalling Contral.
LCD_WriteReg(0x08,0x0207); //front porch=2, back porch=7
LCD_WriteReg(0x09,0x000f); //Display Contral 3.(0x0000)
LCD_WriteReg(0x0a,0x0000); //Frame Cycle Contal.(0x0000)
LCD_WriteReg(0x0c,0x0001); //16-bit RGB interface
LCD_WriteReg(0x0d,0x0000); //Frame Maker osition.
    /*DPL = “0” The data is input on the rising edge of DOTCLK
      EPL = “0” The data DB17-0 is written when ENABLE = “0”. Disable data write operation when ENABLE = “1”. 
    */
LCD_WriteReg(0x0f,0x0000);     
delay_ms(50); 
LCD_WriteReg(0x07,0x0101); //Display Contral.
delay_ms(50);    
LCD_WriteReg(0x10,0x1090); //Power Control 1.(0x16b0)
LCD_WriteReg(0x11,0x0007); //Power Control 2.(0x0001)
LCD_WriteReg(0x12,0x0090);     //Power Control 3.(0x0138)
LCD_WriteReg(0x13,0x0b00); //Power Control 4.
LCD_WriteReg(0x29,0x0000); //Power Control 7.

LCD_WriteReg(0x2b,0x0000);//Set the frame rate when the internal resistor is used for oscillator circuit     
LCD_WriteReg(0x50,0x0000); //Set X Star
//水平GRAM终止位置Set X End.
LCD_WriteReg(0x51,239); //Set Y Star
LCD_WriteReg(0x52,0x0000); //Set Y End.t.
LCD_WriteReg(0x53,319); //240*320

LCD_WriteReg(0x60,0x2700); //扫描320lines
LCD_WriteReg(0x61,0x0003); //Driver Output Control.
LCD_WriteReg(0x6a,0x0000); //Vertical Srcoll Control.

LCD_WriteReg(0x80,0x0000); //Display osition? artial Display 1.
LCD_WriteReg(0x81,0x0000); //RAM Address Start? artial Display 1.
LCD_WriteReg(0x82,0x0000); //RAM Address End-Partial Display 1.
LCD_WriteReg(0x83,0x0000); //Displsy osition? artial Display 2.
LCD_WriteReg(0x84,0x0000); //RAM Address Start? artial Display 2.
LCD_WriteReg(0x85,0x0000); //RAM Address End? artial Display 2.

LCD_WriteReg(0x90,0x0000); //Frame Cycle Contral.(0x0013)
LCD_WriteReg(0x92,0x0000); //Panel Interface Contral 2.(0x0000)
LCD_WriteReg(0x93,0x0001); //Panel Interface Contral 3.
LCD_WriteReg(0x95,0x0110); //Frame Cycle Contral.(0x0110)
LCD_WriteReg(0x97,(0<<8)); //
LCD_WriteReg(0x98,0x0000); //Frame Cycle Contral.    
LCD_WriteReg(0x07,0x0173); //(0x0173)
}  
LCD_LED=1;//点亮背光  
LCD_Clear(WHITE);
}
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-7-20 14:05

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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