打印

TFT 显示问题 知道的帮忙--

[复制链接]
2345|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 SLEET1986 于 2011-4-16 11:01 编辑

ILI9325控制芯片,不知道为什么显示彩色图片会显示成这样----使用的STM32 FSMC
显示单一颜色没问题的。取模的彩色图片就显示成下面的样子了。
void LCD_Setup(void)
{
/* Configure the LCD Control pins --------------------------------------------*/
LCD_CtrlLinesConfig();
GPIO_ResetBits(GPIOC, GPIO_Pin_1);
    Delay(0x5FFFF);        
    GPIO_SetBits(GPIOC, GPIO_Pin_1 );     
Delay(0x5FFFF);
   //************* Start Initial Sequence **********//
LCD_WriteReg(0x00E3, 0x3008); // Set u16ernal timing
LCD_WriteReg(0x00E7, 0x0012); // Set u16ernal timing
LCD_WriteReg(0x00EF, 0x1231); // Set u16ernal timing
LCD_WriteReg(0x0001, 0x0000); // set SS and SM bit    /0X0100
LCD_WriteReg(0x0002, 0x0700); // set 1 line inversion
LCD_WriteReg(0x0003, 0x0008); // set GRAM write direction and BGR=1.//1038
LCD_WriteReg(0x0004, 0x0000); // Resize register
LCD_WriteReg(0x0008, 0x020E); // 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 u16erface setting 0X000
LCD_WriteReg(0x000D, 0x0000); // Frame marker Position
LCD_WriteReg(0x000F, 0x0000); // RGB u16erface 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(0XAFFFF); // Dis-charge capacitor power voltage
LCD_WriteReg(0x0010, 0x1290); // SAP, BT[3:0], AP, DSTB, SLP, STB
LCD_WriteReg(0x0011, 0x0221); // R11h=0x0221 at VCI=3.3V, DC1[2:0], DC0[2:0], VC[2:0]
Delay(0XAFFFF); // Delay 50ms
LCD_WriteReg(0x0012, 0x001A); // External reference voltage= Vci;
Delay(0XAFFFF); // Delay 50ms
LCD_WriteReg(0x0013, 0x1600); // R13=0F00 when R12=009E;VDV[4:0] for VCOM amplitude
LCD_WriteReg(0x0029, 0x0022); // R29=0019 when R12=009E;VCM[5:0] for VCOMH
LCD_WriteReg(0x002B, 0x000A); // Frame Rate
Delay(0XAFFFF); // Delay 50ms
LCD_WriteReg(0x0020, 0x0000); // GRAM horizontal Address
LCD_WriteReg(0x0021, 0x0000); // GRAM Vertical Address
// ----------- Adjust the Gamma Curve ----------//
LCD_WriteReg(0x0030, 0x0000);
LCD_WriteReg(0x0031, 0x0302);
LCD_WriteReg(0x0032, 0x0202);
LCD_WriteReg(0x0035, 0x0103);
LCD_WriteReg(0x0036, 0x080C);
LCD_WriteReg(0x0037, 0x0505);
LCD_WriteReg(0x0038, 0x0504);
LCD_WriteReg(0x0039, 0x0707);
LCD_WriteReg(0x003C, 0x0301);
LCD_WriteReg(0x003D, 0x1008);
//------------------ 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 0x2700
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(0x0093, 0x0003);
LCD_WriteReg(0x0095, 0x0110);
LCD_WriteReg(0x0097, 0x0000);
LCD_WriteReg(0x0098, 0x0000);
LCD_WriteReg(0x0007, 0x0133); // 262K color and display ON
}
LCD显示
void LCD_Draw(uc8 *Pict)
{
   u32 index = 0, i = 0;
   u16 data =0;
   address_set(50,60,169,219);
   LCD_SetCursor(50, 60);
   LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
  for(index = 0; index < 120*160; index++)
  {     
     data = ((*Pict)<<8);
           data |= *(Pict+1);
           Pict +=2;
     LCD_WriteRAM(data);   
  }
  LCD_WriteRAM_Ready();
}

IMG.JPG (635.63 KB )

IMG.JPG

123.jpg (4.87 KB )

123.jpg

相关帖子

沙发
delin17| | 2011-4-16 11:11 | 只看该作者
图片数据格式,怎么感觉是YUV信号用RGB显示的

使用特权

评论回复
板凳
SLEET1986|  楼主 | 2011-4-16 12:26 | 只看该作者
用Image2Lcd取模的16位真彩色

使用特权

评论回复
地板
SLEET1986|  楼主 | 2011-4-16 15:21 | 只看该作者
解决了,程序数据溢出,没想到碰到这样的问题--

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:long long ago

24

主题

1438

帖子

2

粉丝