iam very new to micocontroller and i just try to get a LCD 4-bit mode to work.
My hardware is
1) Easy AVR Board
2) ATMEGA 16
3) 1x LCD 4-bit mode
Code: Select all
// Lcd pinout settings
sbit LCD_RS at PORTD2_bit;
sbit LCD_EN at PORTD3_bit;
sbit LCD_D7 at PORTD7_bit;
sbit LCD_D6 at PORTD6_bit;
sbit LCD_D5 at PORTD5_bit;
sbit LCD_D4 at PORTD4_bit;
// Pin direction
sbit LCD_RS_Direction at DDD2_bit;
sbit LCD_EN_Direction at DDD3_bit;
sbit LCD_D7_Direction at DDD7_bit;
sbit LCD_D6_Direction at DDD6_bit;
sbit LCD_D5_Direction at DDD5_bit;
sbit LCD_D4_Direction at DDD4_bit;
void main()
{
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,"Hi"); // Write text in first row
}
if anyone need any further information, please let me know and i will try to give you them.