ili9341为什么显示出来只有8位 {MOD}的效果

2019-07-21 09:03发布

mcu:stm32f407
lcd:ili9341
驱动方式:fsmc(原子初始化代码)
问题:显示各种纯 {MOD}正常,显示图片或者图标就只有8位 {MOD}的效果,颜 {MOD}过渡的地方惨不忍睹,
2片9341都一样问题,ssd1289就正常,各种调初始化参数无果,百度了也有同样问题的但都没有解决,
if(lcddev.id==0X9341) //9341初始化
{  
LCD_WR_REG(0xCF);  
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0xC1); 
LCD_WR_DATA(0X30);

LCD_WR_REG(0xED);  
LCD_WR_DATA(0x64); 
LCD_WR_DATA(0x03); 
LCD_WR_DATA(0X12); 
LCD_WR_DATA(0X81);

LCD_WR_REG(0xE8);  
LCD_WR_DATA(0x85); 
LCD_WR_DATA(0x10); //00
LCD_WR_DATA(0x7A);//78

LCD_WR_REG(0xCB);  
LCD_WR_DATA(0x39); 
LCD_WR_DATA(0x2C); 
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0x34); 
LCD_WR_DATA(0x02);

LCD_WR_REG(0xF7);  
LCD_WR_DATA(0x20);

LCD_WR_REG(0xEA);  
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0x00);

LCD_WR_REG(0xC0);    //Power control 
LCD_WR_DATA(0x1B);   //VRH[5:0]          10*********

LCD_WR_REG(0xC1);    //Power control         
LCD_WR_DATA(0x01);   //SAP[2:0];BT[3:0]  10************

LCD_WR_REG(0xC5);    //VCM control 
LCD_WR_DATA(0x30); //3F
LCD_WR_DATA(0x30); //3C 50

LCD_WR_REG(0xC7);    //VCM control2 
LCD_WR_DATA(0XB7);   //a4

LCD_WR_REG(0x36);    // Memory Access Control 内存访问控制
LCD_WR_DATA(0x48); //08

LCD_WR_REG(0x3A);   
LCD_WR_DATA(0x55); 

LCD_WR_REG(0xB1);   
LCD_WR_DATA(0x00);   
LCD_WR_DATA(0x1A);

LCD_WR_REG(0xB6);    // Display Function Control显示功能控制 颜 {MOD}值刚刚好相反
LCD_WR_DATA(0x0A); 
LCD_WR_DATA(0xA2); //

LCD_WR_REG(0xF2);    // 3Gamma Function Disable 3伽马函数禁用
LCD_WR_DATA(0x00);

LCD_WR_REG(0x26);    //Gamma curve selected //伽马设置
LCD_WR_DATA(0x01);   //选择伽马曲线1

LCD_WR_REG(0xE0);    //Set Gamma 正极伽马校准
LCD_WR_DATA(0x0F); 
LCD_WR_DATA(0x2A); 
LCD_WR_DATA(0x28); 
LCD_WR_DATA(0x08); 
LCD_WR_DATA(0x0E); 
LCD_WR_DATA(0x08); 
LCD_WR_DATA(0x54); 
LCD_WR_DATA(0XA9); 
LCD_WR_DATA(0x43); 
LCD_WR_DATA(0x0A); 
LCD_WR_DATA(0x0F); 
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0x00);

LCD_WR_REG(0XE1);    //Set Gamma 负极伽马校准
LCD_WR_DATA(0x00); 
LCD_WR_DATA(0x15); 
LCD_WR_DATA(0x17); 
LCD_WR_DATA(0x07); 
LCD_WR_DATA(0x11); 
LCD_WR_DATA(0x06);
LCD_WR_DATA(0x2B); 
LCD_WR_DATA(0x56); 
LCD_WR_DATA(0x3C); 
LCD_WR_DATA(0x05); 
LCD_WR_DATA(0x10); 
LCD_WR_DATA(0x0F); 
LCD_WR_DATA(0x3F); 
LCD_WR_DATA(0x3F); 
LCD_WR_DATA(0x0F);

LCD_WR_REG(0x2B); 
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x01);
LCD_WR_DATA(0x3f);

LCD_WR_REG(0x2A); 
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0xef);  
LCD_WR_REG(0x11);  delay_ms(120); //Exit Sleep 退出睡眠模式
LCD_WR_REG(0x29); //delay_ms(10);//display on
}

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。