Difference between revisions of "Interfacing LCD with Starter AVR"
Line 55: | Line 55: | ||
=Demo= | =Demo= | ||
+ | The images below shows 16x2, 16x1 and 20x4 LCD's interfaced with starter AVR. | ||
+ | <br/> | ||
+ | [[file:0_lcd2_starter.JPG]] | ||
+ | <gallery> | ||
+ | file:lcd1_starter.JPG|16x1 LCD | ||
+ | file:lcd3_starter.JPG|20x4 LCD | ||
+ | </gallery> | ||
+ | |||
=Downloads= | =Downloads= |
Revision as of 12:17, 2 April 2016
Contents
[hide]Basic
Hookup
Code
LCD 16x1
- #include "lcd.h"
- int main()
- {
- /*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTC.4 to PORTC.7*/
- LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PC_4,PC_5,PC_6,PC_7);
- LCD_Init(1,16);
- LCD_DisplayString("Explore");
- while(1);
- return (0);
- }
LCD 16x2
- #include "lcd.h"
- int main()
- {
- /*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTC.4 to PORTC.7*/
- LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PC_4,PC_5,PC_6,PC_7);
- LCD_Init(2,16);
- LCD_DisplayString("Explore Embedded");
- LCD_DisplayString("Lcd 4-bit Mode");
- while(1);
- return (0);
- }
LCD 20x4
- #include "lcd.h"
- int main()
- {
- /*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTC.4 to PORTC.7*/
- LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PC_4,PC_5,PC_6,PC_7);
- LCD_Init(4,20);
- LCD_DisplayString("Explore Embedded\n");
- LCD_DisplayString("LCD 4-bit Mode\n");
- LCD_DisplayString("20 x 4 \n");
- LCD_DisplayString(":) :O");
- while(1);
- return (0);
- }
Demo
The images below shows 16x2, 16x1 and 20x4 LCD's interfaced with starter AVR.