fbpx

Interface LCD With AVR

Description

Liquid crystal display is a very essential part of all embedded devices from calculator to printing machines, LCD works with voltage pulses, with two are more kind of ic drivers in LCD display form LCD module.

LCD Pin Configuration

LCD command

Hardware Required

  • LCD.
  • PotentioMeter.
  • Atmega16 MicroController.

Circuit

Virtual Circuit

Code

 #include <avr/io.h>
 #include <util/delay.h>
 void cmd();
 void dat();
 int a;
 int main(void)
 {
 DDRC=0xff;
 DDRD=0xff;
 while(1)
 {
 a=0x38;
 cmd();
 a=0x0c;
 cmd();
 a=0x01;
 cmd();
 a='A';
 dat();
 a='B';
 dat();
 }
 }
 void cmd()
 {
 PORTC=0x04;
 PORTD=a;
 _delay_ms(1000);
 PORTC=0x00;
 }
 void dat()
 {
 PORTC=0x05;
 PORTD=a;
 _delay_ms(1000);
 PORTC=0x01;
 } 

Leave a Reply

Your email address will not be published. Required fields are marked *