那啥,我是新手,问的问题比较幼稚,别奇怪啊!
最近在做一个小项目,我用STM8S207R8控制ILI9341驱动初始化,根据网上的ILI9341驱动初始化程序,但是初始化不成功,用示波器检查一下,发现从开始接电,复位脚的电压就一直是2.5V。代码如下:
void LCD_init(void)
{
RST->SR|=0x08;
Delay(2);
RST->SR&=~0x08;
Delay(20);
RST->SR|=0x08;
Delay(240);
//ILI9327,BOE3.0
//************* Start Initial Sequence **********//
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);
LCD_WR_DATA(0x7A);
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(0x21); //VRH[5:0]
LCD_WR_REG(0xC1); //Power control
LCD_WR_DATA(0x13); //SAP[2:0];BT[3:0]
LCD_WR_REG(0xC5); //VCM control
LCD_WR_DATA(0x3F);
LCD_WR_DATA(0x3C);
LCD_WR_REG(0xC7); //VCM control2
//LCD_WR_DATA(0XAE);
LCD_WR_DATA(0x90);
LCD_WR_REG(0x36); // Memory Access Control
//LCD_WR_DATA(0x08);
LCD_WR_DATA(0XA8);
LCD_WR_REG(0x3A);
LCD_WR_DATA(0x55);
LCD_WR_REG(0xB1);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x16);
LCD_WR_REG(0xB6); // Display Function Control
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0xA2);
LCD_WR_REG(0xF6);
LCD_WR_DATA(0x01);
LCD_WR_DATA(0x30);
LCD_WR_REG(0xF2); // 3Gamma Function Disable
LCD_WR_DATA(0x00);
LCD_WR_REG(0x26); //Gamma curve selected
LCD_WR_DATA(0x01);
#if 0
LCD_WR_REG(0xE0); //Set Gamma
LCD_WR_DATA(0x0F);
LCD_WR_DATA(0x24);
LCD_WR_DATA(0x22);
LCD_WR_DATA(0x0D);
LCD_WR_DATA(0x11);
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0x52);
LCD_WR_DATA(0XD9);
LCD_WR_DATA(0x43);
LCD_WR_DATA(0x0D);
LCD_WR_DATA(0x13);
LCD_WR_DATA(0x04);
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0x05);
LCD_WR_DATA(0x00);
LCD_WR_REG(0XE1); //Set Gamma
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x1B);
LCD_WR_DATA(0x1D);
LCD_WR_DATA(0x03);
LCD_WR_DATA(0x0E);
LCD_WR_DATA(0x05);
LCD_WR_DATA(0x2D);
LCD_WR_DATA(0x26);
LCD_WR_DATA(0x3C);
LCD_WR_DATA(0x03);
LCD_WR_DATA(0x0C);
LCD_WR_DATA(0x0B);
LCD_WR_DATA(0x35);
LCD_WR_DATA(0x3A);
LCD_WR_DATA(0x0F);
#endif
LCD_WR_REG(0xE0); //Set Gamma
LCD_WR_DATA(0x0F);
LCD_WR_DATA(0x24);
LCD_WR_DATA(0x21);
LCD_WR_DATA(0x0C);
LCD_WR_DATA(0x0F);
LCD_WR_DATA(0x09);
LCD_WR_DATA(0x4D);
LCD_WR_DATA(0XB8);
LCD_WR_DATA(0x3C);
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0x13);
LCD_WR_DATA(0x04);
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0x05);
LCD_WR_DATA(0x00);
LCD_WR_REG(0XE1); //Set Gamma
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x1B);
LCD_WR_DATA(0x1E);
LCD_WR_DATA(0x03);
LCD_WR_DATA(0x10);
LCD_WR_DATA(0x06);
LCD_WR_DATA(0x32);
LCD_WR_DATA(0x47);
LCD_WR_DATA(0x43);
LCD_WR_DATA(0x05);
LCD_WR_DATA(0x0C);
LCD_WR_DATA(0x0B);
LCD_WR_DATA(0x35);
LCD_WR_DATA(0x3A);
LCD_WR_DATA(0x0F);
LCD_WR_REG(0x11); //Exit Sleep
Delay(120);
LCD_WR_REG(0x29); //Display on
}
求高手指点,怎么样实现复位脚拉高,或者拉低。
此帖出自
小平头技术问答
一周热门 更多>