Documente Academic
Documente Profesional
Documente Cultură
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