为了避免大家做重复的劳动,我把我已经调试过的LCD初始化代码贴在下面,希望能给使用MC9RS08LA8的朋友做些参考.
void LcdInit(void)
{
LCDC0_SOURCE=0; //Selects the ICSERCLK (external clock reference) as the LCD clock source.
LCDSUPPLY_CPSEL=1;//LCD charge pump is selected. Resistor network disabled
LCDSUPPLY_LADJ=3;//High Load (LCD glass capacitance 8000pf or lower)
LCDSUPPLY_VSUPPLY=3;//Drive VLL3 externally
LCDC1_LCDIEN=0;//No interrupt request is generated by this event.
LCDC1_LCDWAI=1;// Disables the LCD driver and charge pump when MCU goes into wait mode.
LCDC1_LCDSTP=1;// Disables LCD module driver and charge pump when MCU goes into stop.
LCDC0_DUTY=3;//Use 4 BP (1/4 duty cycle).
LCDC0_LCLK =2;//
LCDBCTL_ALT=0;// Normal Display
LCDBCTL_BLANK=0;// Normal or Alternate Display
LCDBCTL_BMODE=0;//Display blank during the blink period
LCDBCTL_BRATE=3;//when LCD Clock is 32.768 khz,Blink Frequency (Hz) is 1Hz.
LCDPEN0=0XFF; //LCD operation enabled on LCDn. LCD0-LCD17
LCDPEN1=0XFF;
LCDPEN2=0X03;
LCDPEN3=0X00;
LCDBPEN0=0X0F; // Backplane operation enabled on LCD[0]-LCD[3].
LCDBPEN1=0X00;
LCDBPEN2=0X00;
LCDBPEN3=0X00;
LCDWF0=0X01; //sets LCD[0] to be active in Phase A, LCD[1] to be active in Phase B
LCDWF1=0X02;
LCDWF2=0X04;
LCDWF3=0X08;
LCDC0_LCDEN=1; //Enable LCD module (LCDEN bit).
} |