STM32 用FSMC驱动ILI9320 问题

2019-03-23 20:10发布

液晶驱起来了 但是在送单 {MOD}的测试数据时候 有明显的亮纹  怎么办 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
2条回答
hl449006540
2019-03-24 05:15
void STM3210E_LCD_Init(void){
#if ISRST == 0    GPIOB->ODR |= 0x02;    _delay_ms(1);
    GPIOB->ODR &= ~(0x02);    _delay_ms(1);    GPIOB->ODR |= 0x02;#endif    _delay_ms(50); /* delay 50 ms */

#ifdef ILI9325         LCD_WriteReg(0x00e3,0x3008); LCD_WriteReg(0x00e7,0x0012); LCD_WriteReg(0x00ef,0x1231);//Set the internal vcore voltage LCD_WriteReg(0x0001,0x0100);//S#endif  #ifdef ILI9320 LCD_WriteReg(0x00e5,0x8000); LCD_WriteReg(0x0000,0x0001); LCD_WriteReg(0x0001,0x0100);//S#endif         LCD_WriteReg(0x0002,0x0700);//Line inversion        #if   ID_AM==000        LCD_WriteReg(0x0003,0x0000);//屏幕旋转控制 TFM=0,TRI=0,SWAP=1,16 bits system interface  swap RGB to BRG,此处ORG和HWM 为0#elif ID_AM==001         LCD_WriteReg(0x0003,0x0008);      #elif ID_AM==010   LCD_WriteReg(0x0003,0x0010);        #elif ID_AM==011 LCD_WriteReg(0x0003,0x0018);#elif ID_AM==100   LCD_WriteReg(0x0003,0x0020);      #elif ID_AM==101   LCD_WriteReg(0x0003,0x0028);      #elif ID_AM==110   LCD_WriteReg(0x0003,0x0030);      #elif ID_AM==111   LCD_WriteReg(0x0003,0x0038);#endif       LCD_WriteReg(0x0004,0x0000); LCD_WriteReg(0x0008,0x0207); LCD_WriteReg(0x0009,0x0000); LCD_WriteReg(0x000a,0x0000); LCD_WriteReg(0x000c,0x0001);//此处配置接口类型 16位 system接口 LCD_WriteReg(0x000d,0x0000); LCD_WriteReg(0x000f,0x0000);       //电源配置 LCD_WriteReg(0x0010,0x0000); LCD_WriteReg(0x0011,0x0000); LCD_WriteReg(0x0012,0x0000); LCD_WriteReg(0x0013,0x0000);
LCD_WriteReg(0x0010,0x17b0); LCD_WriteReg(0x0011,0x0137);
LCD_WriteReg(0x0012,0x0139); LCD_WriteReg(0x0013,0x1700); LCD_WriteReg(0x0029,0x000c); //LCD_WriteReg(0x002b,0x000d);      #if   ID_AM==000          LCD_WriteReg(0x0020,0x00ef);//GRAM水平起始位置 LCD_WriteReg(0x0021,0x013f);      #elif ID_AM==001 LCD_WriteReg(0x0020,0x00ef); LCD_WriteReg(0x0021,0x013f);      #elif ID_AM==010 LCD_WriteReg(0x0020,0x0000); LCD_WriteReg(0x0021,0x013f);      #elif ID_AM==011 LCD_WriteReg(0x0020,0x0000); LCD_WriteReg(0x0021,0x013f);       #elif ID_AM==100 LCD_WriteReg(0x0020,0x00ef); LCD_WriteReg(0x0021,0x0000);      #elif ID_AM==101   LCD_WriteReg(0x0020,0x00ef); LCD_WriteReg(0x0021,0x0000);      #elif ID_AM==110 LCD_WriteReg(0x0020,0x0000); LCD_WriteReg(0x0021,0x0000);      #elif ID_AM==111 LCD_WriteReg(0x0020,0x0000); LCD_WriteReg(0x0021,0x0000);         #endif        LCD_WriteReg(0x0030,0x0000); LCD_WriteReg(0x0031,0x0507); LCD_WriteReg(0x0032,0x0104); LCD_WriteReg(0x0035,0x0105); LCD_WriteReg(0x0036,0x0404); LCD_WriteReg(0x0037,0x0603); LCD_WriteReg(0x0038,0x0004); LCD_WriteReg(0x0039,0x0007); LCD_WriteReg(0x003c,0x0501); LCD_WriteReg(0x003d,0x0404); LCD_WriteReg(0x0050,0x0000);//水平 GRAM起始位置 LCD_WriteReg(0x0051,0x00ef);//水平GRAM终止位置 LCD_WriteReg(0x0052,0x0000);//垂直GRAM起始位置 LCD_WriteReg(0x0053,0x013f);//垂直GRAM终止位置#ifdef ILI9325         LCD_WriteReg(0x0060,0xa700);//G#endif#ifdef ILI9320         LCD_WriteReg(0x0060,0x2700);//G  #endif     LCD_WriteReg(0x0061,0x0001);//Enables the grayscale inversion of the image by setting REV=1.?????????????????????????????? LCD_WriteReg(0x006a,0x0000);//不使用卷曲功能 LCD_WriteReg(0x0080,0x0000); LCD_WriteReg(0x0081,0x0000); LCD_WriteReg(0x0082,0x0000); LCD_WriteReg(0x0083,0x0000); LCD_WriteReg(0x0084,0x0000); LCD_WriteReg(0x0085,0x0000); LCD_WriteReg(0x0090,0x0010); LCD_WriteReg(0x0092,0x0000); LCD_WriteReg(0x0093,0x0003); LCD_WriteReg(0x0095,0x0110); LCD_WriteReg(0x0097,0x0000); LCD_WriteReg(0x0098,0x0000);      //显示画面写入 0x0130是不显示当前画面 //0x0173是显示当前画面 LCD_WriteReg(0x0007,0x0130);#ifdef Immediately LCD_WriteReg(0x0007,0x0173);      #endif   
}

一周热门 更多>