新手上路
- 积分
- 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);
} |
|