Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.

Slides:



Advertisements
Similar presentations
MM Player Supervised by: Dr. Luai Malhis. Prepared by: Mustafa Assaf & Mahmoud Musa.
Advertisements

EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Programmable Keyboard/ Display Interface: 8279
kashanu.ac.ir Microprocessors 6-1 I/O Devices Switches, LED, LCD Lec note 6.
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.
HD44780 LCD programming From the Hardware Side Design and implementation details on the way to a valid SPI-LCD interface driver.
Spring EE 316 Computer Engineering Junior Lab LCD modules.
Spring EE 316 Computer Engineering Junior Lab LCD modules, PROMs, Serial Ports.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
MP3 player on PC using PIC controller via USB. Supervisor: Dmitry Sokolik Performed by: Yoav Gershoni Shachar Faigenblat.
Coordinate Based Tracking System
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
16x2 LCD Module on DE2-115 數位電路實驗 TA: 吳柏辰 Author: Trumen.
Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.
Digital Outputs LCD Display
HD44780 LCD programming From the Hardware Side
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Input/Output Ports and Interfacing
Basic I/O Interface A Course in Microprocessor
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
UniMAP 1 Interfacing Peripherals. UniMAP 2 Interfacing devices on Embedded Linux In general, to interface to a device connected to an embedded Linux platform.
EE 316 Computer Engineering Junior Lab Serial Ports, LCD Displays & PROMs.
9-1 EE 319K Introduction to Microcontrollers Lecture 9:I/O Synchronization; LCD Interfacing; Implementing Local Variables using a Stack Frame; Parameter.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
Module 11 Adapted By and Prepared James Tan © 2001.
PPI-8255.
Lecture 7: Overview Microprocessors / microcontrollers.
Department of Electronic & Electrical Engineering Serial interfaces Serial Interfaces allow communication between devices sending one bit at a time. In.
UNIT 7 - INTRODUCTION TO I/O INTERFACING. TWO MAJOR TYPES OF I/O INTERFACING ISOLATED I/O - DEDICATED I/O INSTRUCTIONS ARE USED TO ACCESS I/O DEVICES.
Department of Electronic & Electrical Engineering Lecture 2 ● Introduction to IO ● Using a subroutine ● Driving a 7seg display.
Department of Electronic & Electrical Engineering Further work? Simple Voltmeter. ● Analogue to Digital converter (MCP3001 SPI ) ● Analogue → 10bit binary.
Serial Peripheral Interface SPI I2C (i-squared cee)
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
ECE 447 Fall 2009 Lecture 12: TI MSP430 External LCD.
I/O Devices Switches, LED, LCD
Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16.
KEYBOARD/DISPLAY CONTROLLER - INTEL Features of 8279 The important features of 8279 are, Simultaneous keyboard and display operations. Scanned keyboard.
LED AND KEYBOARD INTERFACING PREPARED BY :- PREPARED BY :- RAVAL AKASH ( ) RAVAL AKASH ( ) PATEL HARDIK ( ) PATEL HARDIK.
SUBMITTED BY EDGEFX TEAM PORTABLE CODED WIRELESS MESSAGE COMMUNICATION BETWEEN TWO PARTIES SECRETLY WITH LCD DISPLAY.
BATCH MEMBERS R.ABHISHEK-08N41A0401 K.DHEERAJ REDDY-08N41A0412 S.RAJENDRA REDDY-08N41A0458 JYOTHISHMATHI COLLEGE OF ENGINEERING AND TECHNOLOGY,TURKAPALLY.
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.
LCD Interfacing using Atmega 32
SUBMITTED BY EDGEFX TEAM
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
LCD and Keyboard Interfacing
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
GANDHINAGAR INSTITUTE OF TECHNOLOGY
DIGITAL CALCULATOR USING 8051
EET 2261 Unit 11 Controlling LCD and Keypad
LCD and Keyboard Interfacing
EET 2261 Unit 11 Controlling LCD and Keypad
LCD and Keyboard Interfacing
Serial EEPROM (Atmel 24C-512)
SPI Compatible Devices
LCD and Keyboard Interfacing
LCD and Keyboard Sepehr Naimi
HD44780 LCD programming From the Hardware Side
HD44780 LCD programming From the Hardware Side
LCD and Keyboard Interfacing
CTY SAR FCPS Shawn Lupoli, Elliot Tan
LCD (LIQUID CRISTAL DISPLAY) SCREENS
Presentation transcript:

Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.

Department of Electronic & Electrical Engineering Applications Used in many devices which need a simple monochrome display:  FAX machines  Phones.  Industrial test equipment  Volt meters  Student projects ?  Etc...

Department of Electronic & Electrical Engineering Resources  Powertip PC1601A 1x16 LCD data sheet (not much help)  Hitachi HD44780 data sheet (lots of detail)   (recommended)  (I pinched this code)  lcd4bitHello.asm (my example code ) 

Department of Electronic & Electrical Engineering POWERTIP PC 1601A Schematic Showing the HD44780U and the LCD display HD44780 (another micro controller!)

Department of Electronic & Electrical Engineering Hitachi HD44780 LCD microcontroller The HD44780 is a dot-matrix LCD controller Lots of LCDs use this controller. It provides the functionality and memory to drive the LCD. It allows you to use simple interface to drive the display A single HD44780 can display one 8 characters line OR two 8 character lines one 16 character line (pretending to be 2 lines) Can be driven using just 6 connection to the PIC

Department of Electronic & Electrical Engineering PIN Descriptions VSS Power supply (GND) VCC Power supply (+5V) VEE Contrast adjust RS 0 = Instruction input 1 = Data input R/W 0 = Write to LCD module 1 = Read from LCD module EN Enable signal D0-7 Data bus lines 0-7

Department of Electronic & Electrical Engineering Connections (4 bit mode) RW can be set low because we will not be reading from device 4bit mode does not use D0-3

Department of Electronic & Electrical Engineering Sending data/instructions to the LCD Data sent to the LCD controller can be either an:  Instruction (if RS is high)  Data (character) (if RS is low) To send a value (Data/Instruction) to the LCD  Set RS appropriately  Put value onto lines D4-7  Strobe E (low high low)

Department of Electronic & Electrical Engineering LCD Instructions (RS high) --- examples:  Clear LCD  Position the cursor  Set direction of cursor  Set address of cursor  Set 4/8 bit mode  Set single / two line mode  More...

Department of Electronic & Electrical Engineering Display Data RAM (DDRAM) Characters are stored by the HD44780 in Display data RAM (DDRAM) This has a capacity of 80 characters (bytes). DD RAM address is the position of the cursor The DD RAM address layout for 2 line display is.

Department of Electronic & Electrical Engineering Initializing the device. If you are lucky the device will initialize itself on power up. However this will only happen if some conditions are met (e.g. time to go from zero to full power). It is best to do a full software reset.... makes sure the device is initialized properly.

Department of Electronic & Electrical Engineering Reset sequence of LCD (see lcd_init). Wait for about 20mS Send the first init value (0x30) Wait for about 10mS Send second init value (0x30) Wait for about 1mS Send third init value (0x30) Wait for 1mS Select bus width (0x20 for 4-bit) Wait for 1mS

Department of Electronic & Electrical Engineering 88bit version

Department of Electronic & Electrical Engineering Switching to 4 bit Mode We want to use 4bit mode. But controller starts in 8 bit mode! We can switch to 4bit mode by sending B' ' ; DL=0 sets 4 bit mode (note D0-3 can be zero).

Department of Electronic & Electrical Engineering 4 Bit mode  Once in 4 bit mode we can send an 8 bit instructions as 2 nibbles.  High nibble first.  See routine lcd_send_w in the example code

Department of Electronic & Electrical Engineering Writing characters to the LCD. Each character be represented by a byte of data Each location on the display has an address. The controller has a cursor (address of the next character to be written) We write a character to the display by Setting RS high Put character code on data lines Strobe E The cursor is moved ready for the next character.

Character codes.

Department of Electronic & Electrical Engineering Example program lcd4bitHello.asm Example that displays Hello on the LCD display. Initializes the LCD Clears the LCD Sends 'H' 'e' 'l' 'l' 'o'

Department of Electronic & Electrical Engineering Demo: lcd4bitHelloWorld.asm

Department of Electronic & Electrical Engineering Screen Configurations There are various LCD screen sizes. Common ones are 8X1 (one row of 8 characters) 16x1 16x2 20x2 20x4 The driver uses an address to define the position of a character. The location of an address on the display depends on the device. Some 16x1 devices behave differently from others!!!

Department of Electronic & Electrical Engineering The PC 1601A 16x1 LCD display From the controllers point of view it is a 2 line device. The first 8 characters are on line 1 The second 8 characters are on line 2 Each line can have 40 characters (only 8 displayed) There are display shift operations which use this feature.

Department of Electronic & Electrical Engineering Addresses of characters for PC 1601A The second 8 characters start at address 40!! This is because the connections to the controller are like a second line with 40 characters per line!!!!!

Department of Electronic & Electrical Engineering Solution to the exercise  To send characters to the second 8 locations  Send a instruction to set the cursor address to 40  Send more characters

Department of Electronic & Electrical Engineering Set cursor address instruction.

Department of Electronic & Electrical Engineering HD44780 driving a 2 line LCD

Department of Electronic & Electrical Engineering 2 rows mapped onto 1 row.