Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.

Slides:



Advertisements
Similar presentations
Lab 9: Matrix Keypad : ”No Key Press” Analysis Slide #2 Slide #3 ”Press and Hold Key 5” Analysis.
Advertisements

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.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
ASPPRATECH.
Lecture – 7 Basic input and output
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
Digital Outputs LCD Display
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
Input/Output Ports and Interfacing
MICROPROCESSOR INPUT/OUTPUT
COMP3221: Microprocessors and Embedded Systems Lecture 18: Computer Buses and Parallel Input/Output (II) Lecturer: Hui.
Eng.Samra Essalaimeh Philadelphia University 2013/ nd Semester PIC Microcontrollers.
8279 KEYBOARD AND DISPLAY INTERFACING
PHY 201 (Blum)1 Microcode Source: Digital Computer Electronics (Malvino and Brown)
8279 KEYBOARD AND DISPLAY INTERFACING
Parallel I/O. Introduction This section focuses on performing parallel input and output operations on the 68HC11 3 operation types – Simple, blind data.
Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE /17/2008.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
I/O Devices Switches, LED, LCD
BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale ( ) Gargi Patel ( ) Meghna Rathod.
Computer Organization
Embedded Systems Programming (What they do and when / how to use them)
Michael Rahaim, PhD Candidate Multimedia Communications Lab
Embedded Systems Programming
Scrolling LCD using Arduino.
CS4101 嵌入式系統概論 General Purpose IO
LCD Interfacing using Atmega 32
Programming and Debugging with the Dragon and JTAG
Fundamentals of Computer Engineering
LCD AND KEYBOARD INTERFACING
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
Control Unit Lecture 6.
LCD and Keyboard Interfacing
LECTURE Course Name: Computer Application
DIGITAL CALCULATOR USING 8051
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Memory Units Memories store data in units from one to eight bits. The most common unit is the byte, which by definition is 8 bits. Computer memories are.
Pulse Width Modulation (PWM) Motor Feedback - Shaft Encoder
Keyboard/Display Controller INTEL 8279
EET 2261 Unit 11 Controlling LCD and Keypad
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /10/2018.
Interfacing Memory Interfacing.
LCD and Keyboard Interfacing
Figure Pin Positions for Various LCDs from Optrex
ECE 434 Advanced Digital System L12
Keypad Source: under under
EET 2261 Unit 11 Controlling LCD and Keypad
LCD and Keyboard Interfacing
82C55 Programmable Peripheral Interface
8279 – Programmable Keyboard/Display Interface
LCD and Keyboard Interfacing
LCD and Keyboard Sepehr Naimi
Keyboard/Display Controller (8279)
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Decoding and Using a 4x4 Keyboard
8279 – Programmable Keyboard/Display Interface
LCD and Keyboard Interfacing
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
LCD (LIQUID CRISTAL DISPLAY) SCREENS
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
Device Drivers – Digital Voltmeter
LCD AND KEYBOARD INTERFACING
Decoding and Using a 4x4 Keyboard
Presentation transcript:

Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values are needed in a particular application (e.g. setting clock values, entering an alarm code, etc.). The Keypad has 12 buttons arranged in a 4 Row * 3 Column Matrix: C0 C1 C2 R0 1 2 3 R1 4 5 6 R2 7 8 9 R3 * 0 # Interface connections Port bit: 7 6 5 4 3 2 1 0 Keypad signal: N/C R0 R1 R2 R3 C0 C1 C2 Connector pin 0 Column Row 1 2 3 1 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – Keypad (continued) Operation: When a key is pressed, the corresponding row and column signals are connected (according to the matrix). Reading (scanning) the keypad requires: Set the port so that row pins are outputs and column pins are inputs. Use ‘pullup resistors’ to make each column read as a ‘1’ when no key is pressed (i.e. set the pullup resistors ‘on’ on the column bits of the port). (Without the ‘pullup resistors’ the signal lines ‘float’ between 0 and 5 volts and thus can read as either a ‘1’ or ‘0’, i.e. they are unpredictable). For one row at a time, set the output bit to ‘0’, while setting the other row bits to ‘1’. Read all column inputs and check to see if there are any with a ‘0’ value. This indicates that the key where the column crosses the current ‘0’ value row (in step 3) is pressed (otherwise they are pulled high and read as ‘1’). Cycle through steps 3 and 4 for all rows. After a key-press is detected, wait a short time to allow for mechanical bouncing of the key contacts before reading the keypad again (this is called the ‘debounce delay’ – typically between 20 and 100 milliseconds). 2 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

indicate if a ‘special’ key Peripherals – Keypad – A simple demonstration program A simple keyboard demonstration program is available on the course website. The program shows how to set the port for mixed input and output, how to set the pullup resistors, and how to do the row / column scanning. The connection of the keypad, and the output when the ‘5’ key is pressed is shown below. These bits show which key was pressed indicate if a ‘special’ key was pressed (‘*’ ‘0’ ‘#’) 3 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

indicate if a ‘special’ key Peripherals – Keypad – Simple demonstration program (continued) The output when the ‘0’ key is pressed is shown below. (The keys * 0 # are implemented as special keys for illustration of the concept of control keys which have specific handler routines). The ‘special key’ indicator for ‘0’ is illuminated, as well as the key-code value (1011 binary = B hex = 11 decimal). These bits indicate if a ‘special’ key was pressed (‘*’ ‘0’ ‘#’) show which key was pressed 4 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – Liquid Crystal Display (LCD) The LCD provides a versatile means of displaying alphanumeric data and messages (such as error codes, status messages, and user instructions). The LCD can display 2 rows of 16 characters. The cursor can be turned on / off and positioned wherever required. The system clock must be set to 1MHz (set via ‘fuses’) because of timing constraints of the LCD. Fit the LCD via the dedicated connector on the edge of the STK300 board and make sure it is the same way around as shown. LCD display panel 5 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – Liquid Crystal Display (LCD) The LCD is a quite complex peripheral, with its own on-board controller chip (With registers, memory, special command modes etc. Retains data in between data / control inputs). In addition to 8-bit data (Port A, output); there are also various control signals that must be set: ‘Register Select’ Port C bit 6, Low to access command register High to access data register ‘Device Enable’ Port C bit 7, Low to disable LCD, High to enable LCD ‘Write’ Port G bit 0, for write (command or data) ‘Read’ Port G bit 1, for read (command or data) ‘Busy Flag’ Port A bit 7, (from the control register, not data) To access, this bit must be set for input in DDRA and Register Select must be ‘low’ 6 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – Liquid Crystal Display (LCD) - Continued To simplify using the LCD, a library of commonly needed subroutines has been provided (see teachmat). The subroutines provide functions such as: Check if the LCD device is busy, if so wait. Output a function command to the LCD. Clear the LCD display and set the cursor to the 'home' position. Set the cursor to a specific display position. Write a data character to the LCD at the current cursor position. Display a 2-bar bar graph on the LCD. 7 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – Liquid Crystal Display (LCD) - Continued The LCD has a 256 symbol character set: Place this code in the upper 4 bits in the lower 4 bits For example ‘£’ has the code:0xA5 8 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – Liquid Crystal Display (LCD) - Continued The second half of the character set: 9 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich

Peripherals – LCD A simple demonstration program has been provided, showing how to display a message (stored in program memory) on the LCD. The use of the ‘include’ file, and the library subroutines with in it is illustrated. The demonstration program also shows how to use special characters, in addition to standard ASCII alpha-numeric values. 10 Embedded Systems Programming II Richard Anthony, Computer Science, The University of Greenwich