GANDHINAGAR INSTITUTE OF TECHNOLOGY

Slides:



Advertisements
Similar presentations
Introduction to Micro-controllers Anurag Dwivedi.
Advertisements

Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
AVR Programming CS-212 Dick Steflik. ATmega328P I/O for our labs To get data into and out of our Arduino its a little trickier than using printf and.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.
Digital Outputs LCD Display
LCD Interfacing.
AVR Programming: Digital I/O September 10, What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
Chapter 10 Glass Bliss Using the Parallel Master Port to communicate with Alphanumeric LCD displays.
Programming Microcontrollers in C Lecture L7.1. C Data Types TypeSizeRange char1 byte-128 – 127 unsigned char1 byte0 – 255 Int2 bytes – unsigned.
Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.
ECE 447 Fall 2009 Lecture 12: TI MSP430 External LCD.
Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16.
LED AND KEYBOARD INTERFACING PREPARED BY :- PREPARED BY :- RAVAL AKASH ( ) RAVAL AKASH ( ) PATEL HARDIK ( ) PATEL HARDIK.
A.D.Patel institute of technology Sub : LCD and Keyboard interfacing with AVR. prepared by, chokshi abhi p ( ) Guided by, Prof. Asif Thakor.
Interfacing of Input/Output devices with AVR Microcontroller Enrolment No. : Name of the student: SOMAIYA ISHA.
Sitarambhai Naranjibhai Patel Institute of Technology and Research Centre, Umrakh, Bardoli. A Presentation On “ 16x2 LCD Interfacing with AVR atmega32.
LCD AND LCD INTERFACING. INDEX:-  INTRODUCTION  PIN DISCRIPTION  INITIALIZATION OF LCD  LCD INTERFACING  LCD INTERFACING WITH ATMEGA 32  INTERFACING.
CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06.
Computer System Structures
SUBMITTED BY EDGEFX TEAM
WEL COME.
Scrolling LCD using Arduino.
Signal Name Direction w.r.t. Printer Function Summary Pin# (25-DB) CPU
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
LCD Interfacing using Atmega 32
SUBMITTED BY EDGEFX TEAM
Microprocessor and Microcontroller Fundamentals
Microprocessor and Microcontroller Fundamentals
Introduction to Smart Systems
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
LCD AND KEYBOARD INTERFACING
Display Devices 16 x 2 lcd display.
4-Integrating Peripherals in Embedded Systems (cont.)
Input/Output Ports and Interfacing
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
PC CONTROLLED SCROLLING MESSAGE DISPLAY FOR COLLEGE NOTICE BOARD
SUBMITTED BY EDGEFX TEAM
AUTO POWER SUPPLY CONTROL FROM 4 DIFFERENT SOURCES: SOLAR, MAINS, GENERATOR & INVERTOR TO ENSURE NO BREAK POWER.
LCD and Keyboard Interfacing
MGITER,NAVSARI. AVR MICROCONTROLLER AND INTERFACING
SUBMITTED BY EDGEFX TEAM
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
SUBMITTED BY EDGEFX TEAM
SUBMITTED BY EDGEFX TEAM
IPCOWALA INSTITUTE OF ENGINEERING & TECHNOLOGY-DHARMAJ
DIGITAL CALCULATOR USING 8051
Interfacing of LCD with µP
COMP2121: Microprocessors and Interfacing
Arduino Part 1 Topics: Microcontrollers Programming Basics
SMART CARD ENABLED EMPLOYEE IDENTIFICATION FOR SECURITY PURPOSE
EET 2261 Unit 11 Controlling LCD and Keypad
AVR Hardware Connections and Flash Loading
8051 Programming in C rhussin.
LCD and Keyboard Interfacing
EET 2261 Unit 11 Controlling LCD and Keypad
LCD and Keyboard Interfacing
I/O Ports in AVR Sepehr Naimi
AVR Programming in C Chapter 7
AVR Programming in C Chapter 7
LCD and Keyboard Interfacing
LCD and Keyboard Sepehr Naimi
Keyboard/Display Controller (8279)
I/O Ports in AVR Sepehr Naimi
8051 Micro Controller.
LCD and Keyboard Interfacing
LCD (LIQUID CRISTAL DISPLAY) SCREENS
LCD AND KEYBOARD INTERFACING
Presentation transcript:

GANDHINAGAR INSTITUTE OF TECHNOLOGY Active Learning Assignment Sub:- Microcontroller and Interfacing Topic:- LCD Interfacing with ATMega32 Branch :- Electronics & Communication

Group Members:- Faculty-In-charge Prof. Hardik Patel Arshiya Maniar 130120111014 Zulin Patel 130120111021 Riya Simon 130120111024 Faculty-In-charge Prof. Hardik Patel

LCD Interfacing with ATMega32

Contents Displays LCD displays Advantages of LCD displays Pin description of LCD LCD command codes Sending commands and data to LCD Sending 8-bit data to LCD Programming in ‘C’ language References

Displays If keyboard are the predominant means of interface to human input, then visible displays are the universal means of human output. Displays can be grouped in to three broad categories: Single light (e.g. LED Indicators) Single character (e.g. seven segment display) Intelligent alphanumeric (e.g. LCD display)

LCD displays LCD (Liquid Crystal Display) type displays, provide a very convenient way of displaying information or digital data in the form of numbers, letters or even alpha-numerical characters. LCD displays have one major advantage over similar LED types in that they consume much less power. Nowadays both LCD and LED displays are combined together to form larger Dot-Matrix Alphanumeric type displays which can show letters and characters as well as numbers in standard Red or Tri-color outputs.

Advantages of LCD displays LCD’s are finding widespread use replacing seven segment LEDs or multisegment LEDs. This is due to following reasons: The declining prices of LCDs. The ability to display number, character, and graphics. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. Ease of programming for characters and graphics. The declining prices of LCDs The ability to display number, character, and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data. Ease of programming for characters and graphics.

Pin description of LCD display

Power supply to control Contrast 4 RS Pin No. Name Description 1 VSS Power supply (GND) 2 VCC Power supply (+5V) 3 VEE Power supply to control Contrast 4 RS 0 = Instruction input / 1 = Data input 5 R/W 0 = Write to LCD module / 1 = Read from LCD module 6 EN Enable signal 7 D0 Data bus line 0 (LSB) 8 D1 Data bus line 1 9 D2 Data bus line 2 10 D3 Data bus line 3 11 D4 Data bus line 4 12 D5 Data bus line 5 13 D6 Data bus line 6 14 D7 Data bus line 7 (MSB) Rs = register select

LCD Command Codes Code (Hex) Command to LCD Instruction (Register) 1 Clear display 2 Return home 4 Decrement cursor (shift cursor to left) 6 Increment cursor (shift cursor to right) 5 Shift display right 7 Shift display left 8 Display off, cursor off A Display off, cursor on C Display on, cursor off E Display on, cursor blinking F

LCD command codes (Cont’d) 10 Shift cursor position to left 14 Shift cursor position to right 18 Shift the entire display to the left 1C Shift the entire display to the right 80 Force cursor to beginningof first line C0 Force cursor to beginning of second line 28 38

Sending commands and data to LCD  

Sending commands and data to LCD (Cont’d)  

Sending 8-bit data to LCD To write “Hello” on the LCD using 8-bit data. Interfacing LCD with atmega32 LCD Connections for 8-bit Data

LCD PROGRAMMING IN ASSEMBLY LANGUAGE . INCUDE “M32DEF.INC” .EQU LCD_DPRT = PORTA .EQU LCD_DDDR = DDRA .EQU LCD_DPIN = PINA .EQU LCD_CPRT = PORTB .EQU LCD_CDDR = DDRB .EQU LCD_CPIN = PINB .EQU LCD_RS = 0 .EQU LCD_RW = 1 .EQU LCD_EN = 2 LDI R21, HIGH (RAMEND) OUT SPH,R21 LDI R21,LOW (RAMEND) LDI SPL,R21 RAMEND = last location of RAM

 

 

 

LCD programming in ‘C’ language  #include<avr/io.h> #include<util/delay.h>   #define lcd_data PORTA        // LCD data port #define ctrl PORTB #define en PB2         // enable signal #define rw PB1         // read or write signal #define rs PB0         // register select signal void lcd_cmd(unsigned char cmd); void init_lcd(void); void lcd_write(unsigned char data);

int main() { DDRA=0xFF; DDRB=0x07; init_lcd(); // initialization of LCD _delay_ms(50); // delay of 50ms lcd_write_string(“Hello"); // prints string on LCD return 0; } void init_lcd(void) lcd_cmd(0x38); // LCD initialization _delay_ms(1); lcd_cmd(0x01); // clear LCD

 lcd_cmd(0x0E);     // cursor ON     _delay_ms(1);       lcd_cmd(0x80);    // ---8 go to first line and --0 is for 0th position     return; }  void lcd_cmd(unsigned char cmd) {     lcd_data=cmd;     ctrl =(0<<rs)|(0<<rw)|(1<<en);         ctrl =(0<<rs)|(0<<rw)|(0<<en);         _delay_ms(50);

void lcd_write(unsigned char data) { lcd_data= data; ctrl = (1<<rs)|(0<<rw)|(1<<en); _delay_ms(1); ctrl = (1<<rs)|(0<<rw)|(0<<en); _delay_ms(50); return ; } void lcd_write_string(unsigned char *str) //store address value of the string in pointer *str int i=0; while(str[i]!='\0‘) // loop will go on till the NULL character in the string { lcd_write(str[i]); // sending data on LCD byte by byte i++; } return;

References AVR microcontroller and embedded system – Muhammad Ali Mazidi, Sepehr Naimi, and Sarmad Naimi. The 8051 microcontroller architecture, programming and its applications – Kenneth J Ayala of Western Carolina University. http://www.electronics-tutorials.ws/ LCDdisplay/bin_3.html

Thank You…