我用标准库做的工程模板,使用官方库的LCD例程做的修改!!
但是硬件仿真的时候,LCD模块的寄存器一个都赋值不了!
请高手指点一下!
代码如下:
void InitSystemClock(void)
{
CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_HSI);
CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_8);
while(CLK_GetSYSCLKSource()!=CLK_SYSCLKSource_HSI)
{
}
}
void InitLcd(void)
{
CLK_PeripheralClockConfig(CLK_Peripheral_RTC,ENABLE);
CLK_PeripheralClockConfig(CLK_Peripheral_LCD,ENABLE);
CLK_RTCClockConfig(CLK_RTCCLKSource_LSI,CLK_RTCCLKDiv_1);
LCD_Init(LCD_Prescaler_1 ,LCD_Divider_18,LCD_Duty_1_4,LCD_Bias_1_3,LCD_VoltageSource_External);
LCD_PortMaskConfig(LCD_PortMaskRegister_0, 0x00);
LCD_PortMaskConfig(LCD_PortMaskRegister_1, 0xff);
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x3f);
LCD_PortMaskConfig(LCD_PortMaskRegister_3, 0x00);
LCD_ContrastConfig(LCD_Contrast_3V3);
LCD_DeadTimeConfig(LCD_DeadTime_0);
LCD_PulseOnDurationConfig(LCD_PulseOnDuration_1);
LCD_Cmd(ENABLE);
}