Vishwakarma government engineering college Prepare by. Hardik Jolapara(140173111012) LCD Interfacing with ATmega16.

Slides:



Advertisements
Similar presentations
Lab7: Introduction to Arduino
Advertisements

What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Input/Output (I/O) Ports and Interfacing
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
HD44780 LCD programming From the Hardware Side Design and implementation details on the way to a valid SPI-LCD interface driver.
Example 11 Analog-to-Digital Converter Lecture L5.1.
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.
EEE305 Microcontroller Systems Lecture 5B: Simple I/O Embedded C using PIC microcontrollers Teaching resources on on
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
Eejit’s guide to using a LCD alphanumeric display with the CCS C compiler 1.Hardware connection 2.The LCD.C include file 3.An example.
Khaled A. Al-Utaibi  What is Arduino?  Arduino Boards  Arduino Shields  Arduino Uno Hardware.
Timers and Interrupts Shivendu Bhushan Sonu Agarwal.
Robotics Research Laboratory Louisiana State University.
PS2 Keyboard Interface Using Spartan-3 Starter Kit Board
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
Digital Outputs LCD Display
COE4OI5 Engineering Design Chapter 2: UP2/UP3 board.
© AJH 2013, V2.0 Computer Programming Embedded Systems Programming Stand-alone code, system initialisation, operating systems. Low-level operations; port.
Input/Output Ports and Interfacing
Practical Electronics & Programming
The miniDragon+ Board and CodeWarrior Lecture L2.1.
1 Lab 1: Introduction. 2 Configure ATMEL AVR Starter Kit 500 (STK500), a prototyping/development board for Lab1. ATmega16 ( V) is the chip used.
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
LCD Interfacing.
UniMAP 1 Interfacing Peripherals. UniMAP 2 Interfacing devices on Embedded Linux In general, to interface to a device connected to an embedded Linux platform.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
Example 11 Analog-to-Digital Converter Lecture L5.1.
Magnitude Comparator Dr. Ahmed Telba.
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.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Atmega328p Introduction for Digital and PWM Output Brion L Fuller II Robotics Club.
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.
Introduction to Projects using Microcontroller Md. Khalilur Rhaman Credit: Interface Lab.
Interfacing of Input/Output devices with AVR Microcontroller Enrolment No. : Name of the student: SOMAIYA ISHA.
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
7 SEGMENT INTERFACE WITH AVR MICROCONTROLLER A. D. Patel Institute Of Technology EC :- Sem VPresent By :- Pratik Makadia ( ) 23 June
1 Lab 4: D/A Converter Lab 4: D/A Converter This is a simple resistive network for a D/A converter Port 1, Port 0 are digital inputs ==> 00 (minimum),
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.
INTERFACING KEYBOARD WITH ATMEGA32 ELECTRONICS & COMMUNICATION TITLE.
ENERGY METER TO INDICATE BILLING IN RUPEES FOR LOAD WISE OR DAY WISE
Scrolling LCD using Arduino.
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
ABSTRACT The outline of the project is Cycle stealing, as a method to remove whole cycle to control AC power the concept of achieving the cycle stealing.
Fundamentals of Computer Engineering
Display Devices 16 x 2 lcd display.
SUBMITTED BY EDGEFX TEAM
AUTO POWER SUPPLY CONTROL FROM 4 DIFFERENT SOURCES: SOLAR, MAINS, GENERATOR & INVERTOR TO ENSURE NO BREAK POWER.
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
GANDHINAGAR INSTITUTE OF TECHNOLOGY
UCD ElecSoc Robotics Club 2017/2018
DIGITAL CALCULATOR USING 8051
Arduino Part 1 Topics: Microcontrollers Programming Basics
SMART CARD ENABLED EMPLOYEE IDENTIFICATION FOR SECURITY PURPOSE
‘SONAR’ using Arduino & ultrasonic distance sensor
SUBMITTED BY EDGEFX TEAM
EET 2261 Unit 11 Controlling LCD and Keypad
Future Designs, Inc. Your Development Partner
EET 2261 Unit 11 Controlling LCD and Keypad
Example 7 Liquid Crystal Display
LCD and Keyboard Sepehr Naimi
HD44780 LCD programming From the Hardware Side
Intro to Micro Controllers
Presentation transcript:

Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16

Concept  LCD is used to provide textual information from microcontroller.  It makes the applications in microcontroller more interactive.  LCD comes in various configurations such as 20 x 2, 16 x 1, 40 x 1, 16 x 2 etc.  Out of these, 16 x 2 is widely used. LCD also has a microcontroller in it.  This microcontroller is already coded to display characters on the screen.  Now we have to send the data to this LCD through our microcontroller by following the given steps

LCD(16*2)  The LCD can be used as 8-bit interface or 4- interface.  In this tutorial I am using 8-bit interface. The whole of PORTB is connected to pins 7-14 of LCD. LCD has three control Pins namely Enable (En is pin 6), Read/Write (RW is pin 5) and Register Select (RS is pin 4).  Writing data or commands on the LCD registers can happen only on the falling edge of the En. So, before sending any command or data  When RW is HIGH, we can read from LCD and when RW is LOW we can print on LCD. Since we want to only print on LCD we can simply Ground the RW pin.  When RS is HIGH, we need to send the character’s value in PORTB and when RS is LOW we need to send the command’s value in PORTB.  So now that we have understood the functioning of LCD, we can move to the coding part of it

AVR Atmega16

Interfacing of AVR & LCD

Hardware required  AVR Trainer Board-100-1pc  AVR USB Programmer-1pc  12V, 1A DC Adapter-1pc  16X2 Alphanumeric LCD(JHD162A)-1pc  1 to 1 Connector-3pcs  10 to 10 FRC Female Connector-2pcs

Connection guide  The step-by-step connection guide for 16X2 Alphanumeric LCD Interfacing with ATmega16 project is as follows:  Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.  Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.  Connect RS, RW & EN pins of LCD control header with PD0, PD1 & PD2 pins of PortD header respectively in AVR Trainer Board-100 with 1 to 1 Connectors.  Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.

 Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.  Connect the AVR USB Programmer to the PC/Laptop’s USB Port directly or with the help of USB AM-FM Cable.  Switch on the power with the help of Power Switch of AVR Trainer Board  Download the 16X2 Alphanumeric LCD Interfacing with ATmega16 Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.  See the output.

Code for LCD  For LCD we require only three primary functions LCD_cmd(), LCD_write() and main() void LCD_cmd(unsigned char cmd); This function takes a character as input which it initialises to PORTB keeping the value or RS LOW (since, we want to send a command).  void LCD_write(unsigned char data); This function to display the character which is taken as input. It should be noted that while displaying the value of RS is HIGH.  Now, either you learn the commands required for the LCD and initialize the LCD using those commands in the main or you can use the functions which I have provided in my code. The Full LCD code is given below. It has many functions which would be useful. The details about the function is given in comments in each function

Working of interfacing  LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications.  These modules are preferred over seven segments and other multi segment LEDs.  When you start working with LCD modules you will start feeling the real power of MCU and your imaginations will be touching sky.  The alphanumeric LCD that we are going to interface is a 16X2 alphanumeric LCD. It means the LCD can display 16 characters in each row and it has two rows. It is a HD44780 controller based LCD.  There are two methods to interface any alphanumeric LCD with AVR ATmega16 microcontroller: 8-bit and 4-bit interfacing method.

 In 8-bit interfacing method, all the eight data pins of the alphanumeric LCD are used and in 4-bit interfacing method, only the upper 4 data pins (D4, D5, D6 and D7) of the alphanumeric LCD are used to send 8-bit data (or command) to the alphanumeric LCD from the microcontroller  In 8-bit method, the 8-bit data (or command) is sent at a time using the 8 data lines of the alphanumeric LCD but in 4-bit method, the 8-bit data (or command) cannot be sent at a time to the alphanumeric LCD. So, the upper 4 bits of data (or command) are sent first and the lower 4 bits are sent later.  In this project, we will learn How to interface a 16X2 alphanumeric LCD with AVR ATmega16 microcontroller using 8-bit interfacing method. Here, we will display “ABLab Solutions” in 1st row and “ in 2nd row of the 16X2 alphanumeric LCD

Programming in ‘C’  //**************************************************************// //System Clock :1MHz //Software :AVR Studio 4 //LCD Data Interfacing :8-Bit //**************************************************************//  #include /*Includes io.h header file where all the Input/Output Registers and its Bits are defined for all AVR microcontrollers*/  #define F_CPU /*Defines a macro for the delay.h header file. F_CPU is the microcontroller frequency value for the delay.h header file. Default value of F_CPU in delay.h header file is (1MHz)*/  #include /*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/  #define LCD_DATA_PORT PORTB /*Defines a macro for the lcd.h header File. LCD_DATA_PORT is the microcontroller PORT Register to which the data pins of the LCD are connected. Default PORT Register for data pins in lcd.h header file is PORTA*/

 #define LCD_CONT_PORT PORTD /*Defines a macro for the lcd.h header File. LCD_CONT_PORT is the microcontroller PORT Register to which the control pins of the LCD are connected. Default PORT Register for control pins in lcd.h header file is PORTB*/  #define LCD_RS PD0 /*Defines a macro for the lcd.h header file. LCD_RS is the microcontroller Port pin to which the RS pin of the LCD is connected. Default Port pin for RS pin in lcd.h header file is PB0*/  #define LCD_RW PD1 /*Defines a macro for the lcd.h header file. LCD_RW is the microcontroller Port pin to which the RW pin of the LCD is connected. Default Port pin for RW pin in lcd.h header file is PB1*/  #define LCD_EN PD2 /*Defines a macro for the lcd.h header file. LCD_EN is the microcontroller Port pin to which the EN pin of the LCD is connected. Default Port pin for EN pin in lcd.h header file is PB2*/  #include /*Includes lcd.h header file which defines different functions for all Alphanumeric LCD(8-Bit Interfacing Method). LCD header file version is 1.1*/

 int main(void) {  DDRB=0xff; /*All the 8 pins of PortB are declared output (data pins of LCD are connected)*/  DDRD=0x07; /*PD0, PD1 and PD2 pins of PortD are declared output (control pins of LCD are connected)*/  char first_row_lcd_display[] =”ABLab Solutions”, second_row_lcd_display[]=” /*Variable declarations*/  lcd_init(); /*LCD initialization*/  lcd_string_write(first_row_lcd_display); /*String display in 1st row of LCD*/  lcd_command_write(0xc0); /*Cursor moves to 2nd row 1st column of LCD*/  lcd_string_write(second_row_lcd_display); /*String display in 2nd row of LCD*/  }

Thank You