Upload
suresh-kuruma
View
217
Download
0
Embed Size (px)
Citation preview
7/29/2019 4 bit lcd
1/4
Why LCD 4-Bit Operation
Circuit
Flow Chart
Code in C
Download Code
LCD 4-BIT OPERATION
In the recent years LCD, is finding in daily use replacing LEDs which may be
Single, Seven Segment or Multi Segment LEDs Because of Declining Pricing
of LCD and ability to display numbers, characters and graphics. Another
advantage of LCD is that, Incorporation of refreshing controller in to LCD for
relieving the CPU of the task of refreshing LCD.
Download Code (KEIL Project) (Zip Format)
Liquid Crystal Display LCD 4-Bit Operation
Interface LCD in 4 bit mode, LCD in 4 bit mode, Interfacing LCD with microcontroller
because information matters Tutorials | Infoletters | News | Search
Why LCD 4-Bit Operation?
You may be Surprised why we using LCD in 4-Bit Mode and How its Possible? LCD in 4-Bit means we are 4 Lines of data bus instead
of using 8 Line data bus. In this Method, we are Splitting Bytes of data in Nibbles. If you successfully interface Microcontroller with LCD
with 4 Pins. Then we can save 4 Lines of Microcontroller, which pins we can used for other purpose. In this Artic le we are using 16 x 2
LCD. Same Process in Repeated For all Type of Character LCDs expect Minor Changes
Circuit
Pic of circuit
How to initialize LCD in 4 bit mode
Lcd is initialize in 4 bit mode. For that 0x30 is the be written 3 times on lcd.
Digital Oscilloscopes Digital Oscilloscopes now from Rohde&Schwarz. Get Details Here! www.scope-of-the-art.com/RTO
Embedded MicrocontrollerSearch Thousands of Catalogs for Embedded Microcontrollerwww.globalspec.com
Custom and Std LCDs Get the best LCD solutions from us Fast, efficient, delightful service www.crystalimage-lcd.com
LG CINEMA 3D
Monitor
Comfortable BatteryFree 3D glassesElectron FreeComfortable Eyeswww. lg .com in -monitor
Wednesday, September 14,
2011
mCard SITE SEARCH
MICROPROCESSOR PRESENTATIONS EMBEDDED LINUX NEWS TUTORIALS / ARTICLES CODE BANK QUERY ABOUT US FAQ INFOLETTER mCARD
7/29/2019 4 bit lcd
2/4
LCD Pin Description
Flow Chart
Pin No Symbol I/O Description
1 Vss - Ground
2 Vcc +5V
3 Vee Contrast Control
4 RS Input Command/Data Register
5 R/W Input Read/Write Register
6 E Input/Output Enable
7 DB0 Input/Output Not Used in 4-Bit Mode
8 DB1 Input/Output Not Used in 4-Bit Mode
9DB2 Input/Output Not Used in 4-Bit Mode
10 DB3 Input/Output Not Used in 4-Bit Mode
11 DB4 Input/Output Data Bus in 4-Bit Mode
12 DB5 Input/Output Data Bus in 4-Bit Mode
13 DB6 Input/Output Data Bus in 4-Bit Mode
14 DB7 Input/Output Data Bus in 4-Bit Mode
15 Vcc - For LCD Back Light
16 Vss - For LCD Back Light
Code in C
#include
#include
#define LCDPORT P2
sbit RS=LCDPORT^0;
sbit RW=LCDPORT 1;
sbit E =LCDPORT 2;
bit status=0;
#define lcd_delay 400
/*
* Function Name : delay
* Input : value
* Output : None
Download Code (KEIL Project) (Zip Format)
7/29/2019 4 bit lcd
3/4
* Description : This Function Gives Approximate Delay required For LCD Intilization
*/
void delay(unsigned int j )
{
unsigned int i=0;
for(i=0;i
7/29/2019 4 bit lcd
4/4
[Home] [Query] [FAQ] [Aboutus] [Contact us] [Sitemap] [Privacy Policy] [Advertise ]
Logos and brand names used in this site are belonging to their respected ow ners. We have us ed them here only for the purpose of infor mation. Enable Active X control f rom internet options of internet
explorer to view all element of this site.
Best view ed in 1024x768 pixels RSS FEED
lcd_com(1);
delay(lcd_delay);
}
/*
* Function Name : lcd_puts
* Input : String
* Output : String
* Description : Display String on LCD
*/
void lcd_puts(char *str)
{
unsigned int i=0;
for(;str[i]!=0;i++)
lcd_data(str[i]);
}
/*
* Function Name : Main* Input : None
Output : None
* Description : Disp lay Character on LCD at Proper Location
*/
void m ain()
{
lcd_ini t(); //Intilize LCD in 4-Bit Mode
lcd_com (0X80); // Start Cursor From First Line
lcd_puts ("Hello"); //Print HELLO on LCD
lcd_com (0XC0); // Start Cursor From Second Line
lcd_puts("World"); //Print HELLO on LCD
while(1 ); //Stay Forever Here
}