用STM8L052R8T6调试液晶,发现用LCD_Contrast_Level_4时,液晶正面看显示比较暗,只有倾斜看才清晰;用LCD_Contrast_Level_7时,液晶就会有鬼影--重影,不知道这个是STM8L驱动不行呢还是液晶不行,或者程序没弄好?
/* Enable RTC clock */
CLK_PeripheralClockConfig(CLK_Peripheral_RTC, ENABLE);
/* Enable LCD clock */
CLK_PeripheralClockConfig(CLK_Peripheral_LCD, ENABLE);
CLK_RTCClockConfig(CLK_RTCCLKSource_LSI, CLK_RTCCLKDiv_1);
//CLK_RTCClockConfig(CLK_RTCCLKSource_HSI, CLK_RTCCLKDiv_2);
/* Initialize the LCD */ //fLCD = 500K/32/26=600.96HZ,Frame frequency = 600.96*1/8 = 75.12HZ
LCD_Init(LCD_Prescaler_1, LCD_Divider_31, LCD_Duty_1_8,
LCD_Bias_1_4, LCD_VoltageSource_Internal);
/* Mask register*/
LCD_PortMaskConfig(LCD_PortMaskRegister_0, 0xCF); //SEG0-3,6-7;
LCD_PortMaskConfig(LCD_PortMaskRegister_1, 0xFF); //SEG8-15
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x07); //SEG16-18
LCD_PortMaskConfig(LCD_PortMaskRegister_3, 0x00);
LCD_PortMaskConfig(LCD_PortMaskRegister_4, 0x00); //
LCD_PortMaskConfig(LCD_PortMaskRegister_5, 0x00);
LCD_ContrastConfig(LCD_Contrast_Level_4);
LCD_DeadTimeConfig(LCD_DeadTime_0);
LCD_PulseOnDurationConfig(LCD_PulseOnDuration_7);
LCD_Cmd(ENABLE); /*!< Enable LCD peripheral */ |