4 bit mode assi

7
Liquid Crystal Display LCD 4-Bit Operation Interface LCD in 4 bit mode, LCD in 4 bit mode, Interfacing LCD with microcontroller WhyLCD4-BitOperation? You may be Surprised why we using LCD in 4-Bit Mode and How it’s 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 Article we are using 16 x 2 LCD. Same Process in Repeated For all Type of Character LCDs expect Minor Changes Circuit How to initialize LCD in 4 bit mode

Upload: sisay-deressa

Post on 09-Nov-2015

216 views

Category:

Documents


0 download

DESCRIPTION

u

TRANSCRIPT

Liquid Crystal Display LCD 4-Bit Operation

Interface LCD in 4 bit mode, LCD in 4 bit mode, Interfacing LCD with microcontroller WhyLCD4-BitOperation?

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 Article we are using 16 x 2 LCD. Same Process in Repeated For all Type of Character LCDs expect Minor Changes

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.

LCD Pin DescriptionPin NoSymbolI/ODescription

1Vss- Ground

2Vcc+5V

3VeeContrast Control

4RSInputCommand/Data Register

5R/WInputRead/Write Register

6EInput/OutputEnable

7DB0Input/OutputNot Used in 4-Bit Mode

8DB1Input/OutputNot Used in 4-Bit Mode

9DB2Input/OutputNot Used in 4-Bit Mode

10DB3Input/OutputNot Used in 4-Bit Mode

11DB4Input/OutputData Bus in 4-Bit Mode

12DB5Input/OutputData Bus in 4-Bit Mode

13DB6Input/OutputData Bus in 4-Bit Mode

14DB7Input/OutputData Bus in 4-Bit Mode

15Vcc-For LCD Back Light

16Vss-For LCD Back Light

Flow Chart

Code in C

#include#include

#define LCDPORT P2sbit 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* Description : This Function Gives Approximate Delay required For LCD Intilization*/

void delay(unsigned int j){ unsigned int i=0; for(i=0;i