Sunteți pe pagina 1din 8

LCD 16x2 Interfacing With Arduino Uno

Pin No Pin Name Pin Description


VSS or
Pin 1 This pin is a ground pin and the LCD is connected to the Ground
GND
VCC or
Pin 2 The VCC pin is used to supply the power to the LCD
VDD
This pin is used for adjusting the contrast of the LCD by connecting the
Pin 3 VEE
variable resistor in between the VCC & Ground.

The RS is known as register select and it selects the Command/Data register.


Pin 4 RS To select the command register the RS should be equal to zero. To select the
Data register the RS should be equal to one.

This pin is used to select the operations of Read/Write. To perform the write
Pin 5 R/W operations the R/W should be equal to zero. To perform the read operations
the R/W should be equal to one.

This is a enable signal pin if the positive pulses are passing through a pin, then
Pin 6 EN
the pin function as a read/write pin.

Pin 7 DB0 to DB7The pin 7 contains total 8 pins which are used as a Data pin of LCD.

This pin is connected to VCC and it is used for the pin 16 to set up the glow of
Pin 15 LED +
backlight of LCD.
This pin is connected to Ground and it is used for the pin 15 to set up the glow
Pin 16 LED –
of backlight of the LCD.
ATMEGA8 ALP FOR DISPLAY IN LCD USING VMLAB SOFTWARE
start: CMD:
LDI R17, 0X5F OUT PORTD,R16 // PortD=R16
OUT SPL, R17 CBI PORTB,0 //RS= 0 for command
LDI R17, 0X04 CBI PORTB,1 // RW=0 for write
OUT SPH, R17 SBI PORTB,2 // EN = 1
LDI R21,0XFF CALL DELY
OUT DDRD,R21 // PORT D AS OUTPUT CBI PORTB,2 // EN = 0
OUT DDRB,R21 // PORT B AS OUTPUT CALL DELY
LDI R16,0X38 //Initliaze LCD RET
CALL CMD // call command (CMD) DAT:OUT PORTD,R16 // PortD=R16
CALL DELY // call delay SBI PORTB,0 //RS= 1 for data
LDI R16,0X0F // Display ON cursor CBI PORTB,1 //RW=0 for write
Blink SBI PORTB,2 // EN = 1
CALL CMD // call command CALL DELY
LDI R16,0X01 // Clear LCD CBI PORTB,2 // EN = 0
CALL CMD // call command CALL DELY
CALL DELY // call delay RET
LDI R16,0X80 // cursor to begin at 1st line DELY: LDI R17,0X05
CALL CMD // call command DO1:LDI R18,0XFF
LDI R16,'H‘ // Display Letter ‘H’ DO:DEC R18
CALL DAT // call data(DAT) BRNE DO
LDI R16,'I‘ // Display Letter ‘I’ DEC R17
CALL DAT // call data(DAT) BRNE DO1
HERE: JMP HERE RET

S-ar putea să vă placă și