bikashh
Full Member level 5
dear friends,
i've got a code for my 20 X 4 LCD for my project using LPC2368 microcontroller.and it is working fine but the below portion is not clear to me...please give some light on it..
code1:
//Initialization:
void LcdInit (void)
{
LCD_IO_init(); //pin configuration
DelayMs(15) ;
DelayMs(15) ;
DelayMs(15) ;
DelayMs(15) ;
LcdCmd1(0x03) ;
DelayMs(6) ;
DelayMs(6) ;
DelayMs(6) ;
DelayMs(6) ;
LcdCmd1(0x03) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
LcdCmd1(0x03) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
LcdCmd1(0x02) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
LcdCmd(0x28) ;
LcdCmd(0x08) ;
LcdCmd(0x0c) ;
LcdCmd(0x06) ;
ClearLine(1);
ClearLine(2);
}
code2://command
void LcdCmd1 (unsigned char cmd)
{
unsigned int temp ;
LCD_SET1 = temp = LCD_DATA & (cmd << 20) ;
LCD_CLR1 = (temp ^ LCD_DATA) | (LCD_RS | LCD_EN);
SmallDelay() ;
LCD_SET1 = LCD_EN ;
SmallDelay() ;
LCD_CLR1 = LCD_EN ;
SmallDelay() ;
}
void LcdCmd (unsigned char cmd)
{
LcdCmd1(cmd >> 4) ;
LcdCmd1(cmd) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
}
queries:
code1:
LcdCmd1(0x03) ;
why 0x03?
code2:
what does the line means
LCD_CLR1 = (temp ^ LCD_DATA) | (LCD_RS | LCD_EN);
thanks in advance
i've got a code for my 20 X 4 LCD for my project using LPC2368 microcontroller.and it is working fine but the below portion is not clear to me...please give some light on it..
code1:
//Initialization:
void LcdInit (void)
{
LCD_IO_init(); //pin configuration
DelayMs(15) ;
DelayMs(15) ;
DelayMs(15) ;
DelayMs(15) ;
LcdCmd1(0x03) ;
DelayMs(6) ;
DelayMs(6) ;
DelayMs(6) ;
DelayMs(6) ;
LcdCmd1(0x03) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
LcdCmd1(0x03) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
LcdCmd1(0x02) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
LcdCmd(0x28) ;
LcdCmd(0x08) ;
LcdCmd(0x0c) ;
LcdCmd(0x06) ;
ClearLine(1);
ClearLine(2);
}
code2://command
void LcdCmd1 (unsigned char cmd)
{
unsigned int temp ;
LCD_SET1 = temp = LCD_DATA & (cmd << 20) ;
LCD_CLR1 = (temp ^ LCD_DATA) | (LCD_RS | LCD_EN);
SmallDelay() ;
LCD_SET1 = LCD_EN ;
SmallDelay() ;
LCD_CLR1 = LCD_EN ;
SmallDelay() ;
}
void LcdCmd (unsigned char cmd)
{
LcdCmd1(cmd >> 4) ;
LcdCmd1(cmd) ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
Delay250() ;
}
queries:
code1:
LcdCmd1(0x03) ;
why 0x03?
code2:
what does the line means
LCD_CLR1 = (temp ^ LCD_DATA) | (LCD_RS | LCD_EN);
thanks in advance