我现在用STM8L152直接驱动LCD屏,出现一直显示的问题,无法清除掉,请大伙帮忙看看,谢谢!
/*IO口初始化*/
PA_DDR = 0xff;
PA_CR1 = 0x8f;//PA4,PA5,PA6对应COM0,COM1,COM2 ,PA7对应SEG0设为推挽输出
PD_DDR = 0xff;
PD_CR1 = 0xfd;//PD1对应COM3 COM口都设为开漏输出
PE_DDR = 0xff;
PE_CR1 = 0xff;//PE0~PE7对应SEG1~SEG8 推挽输出
/*LCD初始化*/
CLK_PeripheralClockConfig(CLK_Peripheral_LCD, ENABLE);
CLK_PeripheralClockConfig(CLK_Peripheral_RTC, ENABLE);//使能RTC时钟
CLK_RTCClockConfig(CLK_RTCCLKSource_HSI, CLK_RTCCLKDiv_16); //RTCCLK = 16MHz /16 = 1MHz
LCD_Init(LCD_Prescaler_32, LCD_Divider_26, LCD_Duty_1_8,LCD_Bias_1_4, LCD_VoltageSource_External);
LCD_PortMaskConfig(LCD_PortMaskRegister_0, 0xFF);//SEG0 ~ SEG7
LCD_PortMaskConfig(LCD_PortMaskRegister_1, 0x1F);//Unused pins as general purpose I/Os
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x00);
LCD_PortMaskConfig(LCD_PortMaskRegister_3, 0x00);
LCD_ContrastConfig(LCD_Contrast_3V3);
LCD_DeadTimeConfig(LCD_DeadTime_1);//一个死区时间
LCD_PulseOnDurationConfig(LCD_PulseOnDuration_7);
//LCD_HighDriveCmd(ENABLE);
LCD_Cmd(ENABLE); |