|
请高手帮忙分析一下,我用STM32F429IG控制器驱动LQ035NC111,将原来的480X272的程序改为320X240的程序:- [font=Arial][/font]//STM32F4x9_uCOSIII\Utilities\STM32_EVAL\STM324x9I_EVAL\stm324x9i_eval_lcd.c
- static uint32_t CurrentLcd = USE_LCD_AM320240;
- static uint32_t LCD_PIXEL_WIDTH = 320;
- static uint32_t LCD_PIXEL_HEIGHT = 240;
- #define HW 40
- #define VW 2
- #define HBP 20
- #define VBP 73
- #define HFP 20
- #define VFP 4
复制代码 void LCD_Init(void)函数中的:- //STM32F4x9_uCOSIII\Utilities\STM32_EVAL\STM324x9I_EVAL\stm324x9i_eval_lcd
- LCD_PIXEL_WIDTH = 320;
- LCD_PIXEL_HEIGHT = 240;
- /* Configure PLLSAI prescalers for LCD */
- /* Enable Pixel Clock */
- /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */
- /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAI_N = 192 Mhz */
- /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAI_R = 192/3 = 64 Mhz */
- /* LTDC clock frequency = PLLLCDCLK / RCC_PLLSAIDivR = 64/8 = 8 Mhz */
- RCC_PLLSAIConfig(192, 7, 4);
- RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div8);
- /* Enable PLLSAI Clock */
- RCC_PLLSAICmd(ENABLE);
- /* Wait for PLLSAI activation */
- while(RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) == RESET)
- {
- }
- /* Timing configuration */
- /* Horizontal synchronization width = Hsync - 1 */
- LTDC_InitStruct.LTDC_HorizontalSync = HW;
- /* Vertical synchronization height = Vsync - 1 */
- LTDC_InitStruct.LTDC_VerticalSync = VW;
- /* Accumulated horizontal back porch = Hsync + HBP - 1 */
- LTDC_InitStruct.LTDC_AccumulatedHBP = HW+HBP;
- /* Accumulated vertical back porch = Vsync + VBP - 1 */
- LTDC_InitStruct.LTDC_AccumulatedVBP = VW+VBP;
- /* Accumulated active width = Hsync + HBP + Active Width - 1 */
- LTDC_InitStruct.LTDC_AccumulatedActiveW = HW+HBP+LCD_PIXEL_WIDTH;
- /* Accumulated active height = Vsync + VBP + Active Heigh - 1 */
- LTDC_InitStruct.LTDC_AccumulatedActiveH = VW+VBP+LCD_PIXEL_HEIGHT;
- /* Total width = Hsync + HBP + Active Width + HFP - 1 */
- LTDC_InitStruct.LTDC_TotalWidth = HW+HBP+LCD_PIXEL_WIDTH+HFP;
- /* Total height = Vsync + VBP + Active Heigh + VFP - 1 */
- LTDC_InitStruct.LTDC_TotalHeigh = VW+VBP+LCD_PIXEL_HEIGHT+VFP;
复制代码 void LCD_LayerInit(void)函数中的:- //STM32F4x9_uCOSIII\Utilities\STM32_EVAL\STM324x9I_EVAL\stm324x9i_eval_lcd.c
- LTDC_Layer_InitStruct.LTDC_HorizontalStart = 1+HBP+50;
- LTDC_Layer_InitStruct.LTDC_HorizontalStop = (LCD_PIXEL_WIDTH +HBP+50 );
- LTDC_Layer_InitStruct.LTDC_VerticalStart = 1+VBP;
- LTDC_Layer_InitStruct.LTDC_VerticalStop = (LCD_PIXEL_HEIGHT + VBP );
复制代码- //STM32F4x9_uCOSIII\Utilities\STM32_EVAL\STM324x9I_EVAL\stm324x9i_eval_lcd.c
- void LCD_CheckDevice(void)
- {
- CurrentLcd = USE_LCD_AM320240;
- }
复制代码- //STM32F4x9_uCOSIII\Utilities\STM32_EVAL\STM324x9I_EVAL\stm324x9i_eval_lcd.h
- typedef enum
- {
- USE_LCD_AM640480 = 0, /*!< LCD Ampire 640x480 */
- USE_LCD_AM480272 = 1, /*!< LCD Ampire 480x272 */
- USE_LCD_AM320240 = 2, /*!< LCD Ampire 320x240 */
- } LCD_Used;
复制代码- //STM32F4x9_uCOSIII\Utilities\STM32_EVAL\Common\lcd_log.h
- #define PIXEL_WIDTH 320
- #define PIXEL_HEIGHT 240
复制代码
接线应该没错,显示屏标题显示正常(字体及背景),但时序参数修改后就不正常了,哪怕是在要求范围内,不知道问题出在哪里? |
|