NEX Robotics
lcd_port = 0x30;
sbit(lcd_port,EN);
_delay_ms(5);
cbit(lcd_port,EN);
_delay_ms(1);
cbit(lcd_port,RS);
cbit(lcd_port,RW);
lcd_port = 0x30;
sbit(lcd_port,EN);
_delay_ms(5);
cbit(lcd_port,EN);
_delay_ms(1);
cbit(lcd_port,RS);
cbit(lcd_port,RW);
lcd_port = 0x20;
sbit(lcd_port,EN);
_delay_ms(5);
cbit(lcd_port,EN);
}
6.1.3 LCD initialization function
//Function to Initialize LCD
void
lcd_init()
{
_delay_ms(1);
lcd_wr_command(0x28);
lcd_wr_command(0x01);
lcd_wr_command(0x06);
lcd_wr_command(0x0E);
lcd_wr_command(0x80);
}
6.1.4 Function to write command on LCD
//Function to write command on LCD
void lcd_wr_command(unsigned char
{
unsigned char temp;
temp = cmd;
temp = temp & 0xF0;
lcd_port &= 0x0F;
lcd_port |= temp;
cbit(lcd_port,RS);
cbit(lcd_port,RW);
sbit(lcd_port,EN);
_delay_ms(5);
www.nex-robotics.com
//Sending 3 in the upper nibble
//Set Enable Pin
//delay
//Clear Enable Pin
//RS=0 --- Command Input
//RW=0 --- Writing to LCD
//Sending 3 in the upper nibble
//Set Enable Pin
//delay
//Clear Enable Pin
//RS=0 --- Command Input
//RW=0 --- Writing to LCD
//Sending 2 in the upper nibble to initialize LCD 4-bit mode
//Set Enable Pin
//delay
//Clear Enable Pin
//4-bit mode and 5x8 dot character font
//Clear LCD display
//Auto increment cursor position
//Turn on LCD and cursor
//Set cursor position
cmd)
}
Fire Bird V Software Manual
cbit(lcd_port,EN);
cmd = cmd & 0x0F;
cmd = cmd<<4;
lcd_port &= 0x0F;
lcd_port |= cmd;
cbit(lcd_port,RS);
cbit(lcd_port,RW);
sbit(lcd_port,EN);
_delay_ms(5);
cbit(lcd_port,EN);
92
Need help?
Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?