Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.

Slides:



Advertisements
Similar presentations
1 The 2-to-4 decoder is a block which decodes the 2-bit binary inputs and produces four output All but one outputs are zero One output corresponding to.
Advertisements

Lab 9: Matrix Keypad : ”No Key Press” Analysis Slide #2 Slide #3 ”Press and Hold Key 5” Analysis.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
Introduction to Micro-controllers Anurag Dwivedi.
Mark Neil - Microprocessor Course 1 Device Drivers – Digital Voltmeter.
Lab 7 : Decoders/Encoders : Slide #2 Slide #3 Slide #4 Slide #5 Slide #6 “1 of 10” Encoder “1 of 10” Encoder Connected to a SPST Keypad. Control Signal.
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.
CHAPTER 4 I/O PORT PROGRAMMING. I/O Port Pins The four 8-bit I/O ports P0, P1, P2 and P3 each uses 8 pins All the ports upon RESET are configured as input,
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
Wireless Phone Tic-Tac-Toe Josh Morelli. Project Description The purpose is to illustrate the interfacing of hardware and wireless phones using standard.
Programming Microcontrollers B. Furman 19MAR2011.
Mark Neil - Microprocessor Course 1 Digital to Analog Converters.
Programming the ATmega16
EEE305 Microcontroller Systems Lecture 5B: Simple I/O Embedded C using PIC microcontrollers Teaching resources on on
Lecture – 7 Basic input and output
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
ECE 447 Fall 2009 Lecture 6: TI MSP430 IO Interfacing.
Robotics Research Laboratory Louisiana State University.
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 12.
You must be knowing about Digital Integrated Circuits (ICs) right ? For example 7404: Hex Inverter 7408: Quad 2-input AND gate 7410: Triple 3-input NAND.
Microprocessor Block Diagram
1 Applied Control Systems Technology. 2 Pin configuration Applied Control Systems.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
I/O Ports CS-280 Dr. Mark L. Hornick 1. CS-280 Dr. Mark L. Hornick 2 Ports are channels from the CPU to external hardware and software Atmega32 has: 4.
Input/Output Ports and Interfacing
I/O PORTS (Simplest Peripherals) PORT A: 6 bits wide (7th and 8th bit always read as 0) PORT B: 8 bits wide PORT C: 8 bits wide PORT D: 8 bits wide.
I/O devices Peripheral devices (also called I/O devices) are pieces of equipment that exchange data with a CPU Examples: switches, LED, CRT, printers,
MOBILE OPERATING ROBOT ON EMBEDDED SYSTEM
FIGURE 9-1 General Parallel I/O Example Peter Spasov Microcontroller Technology: The 68HC11, Fourth Edition Copyright ©2002 by Pearson Education, Inc.
10/24/2015 Amrita Vishwa Vidyapeetham 1 Key Board & LED Interfacing.
Advanced Digital Circuits ECET 146 Week 9 Professor Iskandar Hack ET 221G,
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Inputs.
Digital Inputs Interfacing Keypad
Discussion 2 STATE MACHINES AND AVR ASSEMBLY CMPE 311 / FALL 2015 DR. MOHSENIN & MR. SMITH GTAS: RUTHVIK KUKKAPALLI, AMEY KULKARNI UTAS: JASON KLIMEK,
Robotics Research Laboratory Louisiana State University.
Chris Wallau ECE5330 November 17, 2008 Remote Thermometer and Display.
Keyboard interfacing.
EE 316 Computer Engineering Junior Lab Project 2 Digital Yahtzee.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
KEYBOARD INTERFACING Keyboards are organized in a matrix of rows and columns The CPU accesses both rows and columns through ports. ƒTherefore, with two.
EMBEDDED SYSTEM & ROBOTICS. Introduction to robotics Robots are machines capable of carrying out a complex series of actions automatically. Robotics is.
1 Microprocessors CSE – 341 Basic I/O Interfacing.
Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE /17/2008.
Analog to Digital Conversion - ADC Mark Neil - Microprocessor Course 1 Device Drivers – Measuring Voltages.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Mark Neil - Microprocessor Course 1 Digital to Analog Converters.
ECE 447: Lecture 12 Keypads ECE 447: Lecture 10. ECE 447: Matrix Keypad.
Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch.
ISA CLICK CONTROL #38 – FALL 2014 ERIC BRUNNGRABER DRAKE ISABIRYE.
INTERFACING HARDWARE WITH MICROCONTROLLER GUIDED BY: Prof. ASIF SIR 1. AKSHAY KIRAN 2. DEEP PARIKH 3. JIGAR PATEL 4. TILAK PATEL ,05,D2D06,09.
GSM Controlled Robots.
AVR I/O Port Programming
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 AND KEYBOARD INTERFACING
COMP2121: Microprocessors and Interfacing
Keypad Source: under under
I/O Ports.
Decoding and Using a 4x4 Keyboard
Keypad Source: under under
Keypad Source: under under
LCD AND KEYBOARD INTERFACING
Costas Foudas, Imperial College, Rm: 508, x47590
Decoding and Using a 4x4 Keyboard
Presentation transcript:

Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard

The Keyboard Mark Neil - Microprocessor Course 2 8 lines corresponding to 4 rows and 4 columns 8 lines corresponding to 4 rows and 4 columns By Pressing a button you connect one of the row lines to one of the column lines. By Pressing a button you connect one of the row lines to one of the column lines.

The PCB of the Key-Board Mark Neil - Microprocessor Course 3 The buttons simply connect one row with one column! From this picture you Can see that the keyboard is all PASSIVE: No ICs no Transistors From this picture you Can see that the keyboard is all PASSIVE: No ICs no Transistors

Decoding what key is pressed Step 1: Row We can provide power to the four rows, and readout the data We write 0 to all columns In the example on the right (the 5 is pressed) we will see a 0 on row 2 and 1 on the rest of the rows We then have to determine which column has been pressed 4 Mark Neil - Microprocessor Course

Step 2:Reading the Column If instead of providing power to the rows, we provide power to the columns we can determine which column has a key pressed We write 0 to all the rows In this case we will read 0 on column 1 and 1 on the other rows Hence we know that the ‘5’ was pressed as row 2 and col 1 have a key pressed 5 Mark Neil - Microprocessor Course

Pull-up Resistors on ATmeag128 Ports Mark Neil - Microprocessor Course 6 PORTx : OUTPUT Register DDRx : Direction Reg. PINx : INPUT (no Register) each pin in PORTx is independent! There are pull-up resistors present on-board. Which allow us to put power on the PORT pins. These need to be enabled by writing high levels to input pins.

Reading the Keypad with the ATMega128 Mark Neil - Microprocessor Course 7 We will use PORTE for both Reading the pins and providing the Power. This example is the initial configuration to read the row PORTE bits 4-7 Outputs PORTE bits 0-3 Inputs

Task Plan - Steps Mark Neil - Microprocessor Course 8 Enable the pull-up resistors on bits 0-3 of PORTE and connect the 4 pins of the keyboard. Configure these pins as inputs, the 4 lines will be held high by the pull-up resistors. Connect the rest of keyboard to pins 4-7 of PORTE and configure them as outputs. Write a program that drives the output bits (4-7) of PORTE low all at once read the 4 PORTE input pins (0-3).  Determine which row has a key pressed Now configure bits 0-3 as outputs and bits 4-7 as inputs  Determine which column has a key pressed Determine which key has been pressed Echo the PORTE input to PORTB to use the LEDs to do a quick check of the keyboard. [also output to LCD.]

How to configure PORTE for Step 1 Mark Neil - Microprocessor Course 9 To configure PORTE 4-7 as outputs and PORTE 0-3 as inputs  set DDRE:$F0 Set the PORT REGISTERS in such a way so that the inputs have pull up resistors and the outputs drive low  set PORTE:$0F

Task Mark Neil - Microprocessor Course 10 Write a routine that decodes the key on the 4x4 Keyboard and tells you what key was pressed on the LCD display We need a reliable setup where the ATmega128 interprets relatively quickly any key pressed on the keyboard. Notice that the microprocessor is faster than your finger and can ‘see’ the bouncing up and down that happens when you press the a button of the keyboard.  Write a routine which reliably inputs a key press.  Write a routine which reliably inputs a string of key presses