Decoding and Using a 4x4 Keyboard

Slides:



Advertisements
Similar presentations
JED Microprocessors Pty Ltd Presenting the JED T430 low-cost Projector Controllers Nov 22nd, 2009.
Advertisements

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.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
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.
Mark Neil - Microprocessor Course 1 Digital to Analog Converters.
Review of Wunderboard ECE152. Overview  Hardware  Software Tool chain  Port Pins  LED Array  Analog to Digital Converter.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
Programming the ATmega16
Butterfly I/O Ports CS-212 Dick Steflik. I/O for our labs To get data into and out of our Butterfly its a little trickier than using printf and scanf.
EEE305 Microcontroller Systems Lecture 5B: Simple I/O Embedded C using PIC microcontrollers Teaching resources on on
Robotics Research Laboratory Louisiana State University.
Introduction to Microcontrollers Shivendu Bhushan Summer Camp ‘13.
1 Applied Control Systems Technology. 2 Pin configuration Applied Control Systems.
Microprocessors Tutorial 1: Arduino Basics
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 devices Peripheral devices (also called I/O devices) are pieces of equipment that exchange data with a CPU Examples: switches, LED, CRT, printers,
FIGURE 9-1 General Parallel I/O Example Peter Spasov Microcontroller Technology: The 68HC11, Fourth Edition Copyright ©2002 by Pearson Education, Inc.
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
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.
Microprocessors Tutorial 1: Arduino Basics
Robotics Research Laboratory Louisiana State University.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
KEYBOARD INTERFACING Keyboards are organized in a matrix of rows and columns The CPU accesses both rows and columns through ports. ƒTherefore, with two.
Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE /17/2008.
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.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch.
ISA CLICK CONTROL #38 – FALL 2014 ERIC BRUNNGRABER DRAKE ISABIRYE.
Embedded Systems Programming (What they do and when / how to use them)
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
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
Introduction to Handshaking Communication with SSC-32U
COMP211 Computer Logic Design Introduction to the DE2 Board
Lecture 6: TI MSP430 IO Interfacing
Yeti 400 Reprogram SOP 5/1/2017, Yeti firmware rev. 2.0.
DIGITAL CALCULATOR USING 8051
COMP2121: Microprocessors and Interfacing
QUIZ COMPETITION SENSOR FOR FASTEST FINGER PRESS
Introduction to Arduino Microcontrollers
Keyboard/Display Controller INTEL 8279
EET 2261 Unit 11 Controlling LCD and Keypad
Digital to Analog Converters
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /10/2018.
Keypad Source: under under
EET 2261 Unit 11 Controlling LCD and Keypad
Serial versus Parallel Data Transfers
Tim Sumner, Imperial College, Rm: 1009, x47552
I/O Ports.
CSCI1600: Embedded and Real Time Software
Decoding and Using a 4x4 Keyboard
Keypad Source: under under
Lab 1. Introduction to the DE2 Board
Keypad Source: under under
Lecture 4. Introduction to the DE2 Board
Device Drivers – Digital Voltmeter
CSCI1600: Embedded and Real Time Software
Let’s use a PUSH-Button!
LCD AND KEYBOARD INTERFACING
Costas Foudas, Imperial College, Rm: 508, x47590
Interrupts.
Presentation transcript:

Decoding and Using a 4x4 Keyboard 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

The Keyboard 1 2 3 F 4 5 6 7 8 9 D A B C E By Pressing a button you connect one of the white lines to one of the black lines. But you don’t know which. 1 2 3 F 4 5 6 E 7 8 9 D A B C 8 lines corresponding to 4 rows and 4 columns 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

The PCB of the Key-Board From this picture you get an idea of what exactly happens in the keyboard. IT IS ALL PASSIVE: No ICs no Transistors The buttons as you may guess connect one row with one column !!!! 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Decoding the Key-Board P O R T B 5-7 1 2 3 F 4 5 6 E 7 8 9 D A B C +5 Volts PORTB 0-4 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Costas Foudas, Imperial College, Rm: 508, x47590 Pull-up Resistors on ATmeag103 Ports Port Example: DDRA : Direction Reg. PORTA : OUTPUT Reg. PINA : INPUT (no Reg.) Notice that each pin in PORTB is different !! 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Costas Foudas, Imperial College, Rm: 508, x47590 How to configure PORTB Configure PORTB 5-7 as inputs and PORTB 0-4 as outputs (DDRB: $0F) (2) Set the PORT REGISTERS in such a way so that the inputs have pull up resistors and the outputs drive low (PORTB: $F0) 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Costas Foudas, Imperial College, Rm: 508, x47590 Task Plan I Write a routine that decodes the key on the 4x4 Keyboard and tells you what key was pressed on the LCD display But first you need to know exactly what does the keyboard do internally 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Costas Foudas, Imperial College, Rm: 508, x47590 Task Plan II STEP1: Set the pullup resistors on the 4 bits of port B and connect the 4 pins of the keyboard (through resistor packs). At this point the 4 lines of the keyboard are held high by the pullup resistors (your LEDs should be dark). STEP2: Connect the rest of keyboard pins to 4 PORTB pins (resistor packs). STEP3: Push a keyboard button and have a program that drives the PORTB outputs low one at a time (1110,1101,1011,0111). This should tell you which Pin does is connected with which when you press that button. 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Costas Foudas, Imperial College, Rm: 508, x47590 1 2 3 F 4 5 6 E 7 8 9 D A B C 5V OUT IN Row 2 Pressed, Col ? Not Col 3 Found column = 2 Column Row Pull-up resistors 5 This button pressed. Column wire connected to row wire 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590

Costas Foudas, Imperial College, Rm: 508, x47590 Keyboard  ATmega103 Port We need a reliable setup where the ATmega103 interprets relatively fast any key pressed on the keyboard . Noice that the microprocessor is faster than Your finger and can ‘see’ the bouncing up And down that result when you press the a button of the keyboard. So you need to check if what you read is stable Two questions: (1) What type of hardware setup do we need ? (2) What kind of driver software do we need ? 7/24/2019 Costas Foudas, Imperial College, Rm: 508, x47590