液晶液晶液晶
时间:10-02
整理:3721RD
点击:
下面是1602液晶初始化代码 ,4位模式数据线模式前2-5段是什么意思?前2-5段不写为什么不行 而且指令码没有0X0002和 0X0003//LCD_DATA 端口
//LCD_CMD_W_Timing() 写指令操作时序
void OpenLCD(void)
{
Temp_LCD_DATA = LCD_DATA ; // Save the Port Value of LCD_DATA
LCD_E = 0 ;
LCD_DATA &= 0xfff0; // LCD DB[4:7] & RS & R/W --> Low
DIR_LCD_DATA &= 0xfff0; // LCD DB[4:7} & RS & R/W are output function
DIR_LCD_E = 0; // Set E pin as output
DIR_LCD_RS = 0 ;
DIR_LCD_RW = 0 ;
LCD_DATA &= 0xfff0 ;
LCD_DATA |= 0x0003 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;
LCD_DATA &= 0xfff0 ;
LCD_DATA |= 0x0003 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;
LCD_DATA &= 0xfff0 ;
LCD_DATA |= 0x0003 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;
LCD_DATA &= 0xfff0 ;
LCD_DATA |= 0x0002 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;
WriteCmdLCD(DISP_2Line_4Bit) ;
LCD_S_Delay() ;
WriteCmdLCD(DISP_ON) ;
LCD_S_Delay() ;
WriteCmdLCD(ENTRY_INC) ;
LCD_S_Delay() ;
WriteCmdLCD(CLR_DISP) ;
LCD_L_Delay() ;
LCD_DATA = Temp_LCD_DATA ;
}
有人知道不
高手呢呢?