ECE 447: Lecture 12 Keypads ECE 447: Lecture 10. ECE 447: Matrix Keypad.

Slides:



Advertisements
Similar presentations
What time is it Now?.
Advertisements

TIME PAST O’CLOCK TO HALF TO HALF O’CLOCK PAST.
Telling Time Telling Time by the Hour © Richard A Medeiros 2006 next Quiz.
Things that Come in Arrays
What time is it? What’s the time?
Δημοτικό σχολείο Φλογητών-Ν.Πλαγίων
WHAT TIME IS IT, PLEASE?.
Programmable Interval Timer
Sixteen Squared. 256 One Squared 1 Three Cubed.
Multiplication Facts 9 through x 5= 50 Number One.
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
What time is it? Coo-Coo one o'clock a quarter to seven
?.
It’s nine o’clock
NUMBERS. 1 ONE Mariana T. Vilas Boas, Digital.
Spring EE 316 Computer Engineering Junior Lab Designing State machines for a numeric Keypad.
7-1 Keypad Scanning interface Used for interfacing push-button(momentary) switches Used for large number(>8) push-buttons Relies on matrix arrangement.
Beginning Decimals. Decimal means ten One tenth 1 / Two tenths 2 / Three tenths 3 / Four tenths 4 / Five tenths 5 /
Input/Output Ports and Interfacing
COMP3221: Microprocessors and Embedded Systems Lecture 18: Computer Buses and Parallel Input/Output (II) Lecturer: Hui.
Proportions Round One 2) x + 3 = 15 Answers 2.) x + 3 = 15 X=12 21.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Inputs.
Digital Inputs Interfacing Keypad
CLICK THE NUMBERS IN SEQUENCE
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.
Skip Counting Practice
What time is it ? in the morning / in the afternoon in the evening
START It’s two o’clock It’s a quarter to ten It’s five to eight It’s twenty to one.
2B: Unit 5 What time is it What time is it ? o’clock / half past.
CLICK ON THE CLOCK What’s the time? It’s half past nine. GREAT TRY AGAIN It’s nine o’clock. It’s a quarter to twelve.
BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale ( ) Gargi Patel ( ) Meghna Rathod.
INTERFACING KEYBOARD WITH ATMEGA32 ELECTRONICS & COMMUNICATION TITLE.
By Esra ARAS.
LCD AND KEYBOARD INTERFACING
Things that Come in Arrays
Numbers >100
What time is it? or What’s the time?.
Keypad Source: under under
TWO MINUSES MAKE A PLUS (and other stories)
Numbers, listen and repeat ! ©isagms80.
Time Ballet.
Beginning Decimals. Decimal means ten One tenth 1 / Two tenths 2 / Three tenths 3 / Four tenths 4 / Five tenths 5 /
NUMBERS one two three four five six seven eight
THE BUSY BEE BAŞLA The bee is very busy learning the numbers. Help her with the matching.
Connecting Number Words, Numerals and Models
TO PAST TELLING THE TIME.
WHAT TIME IS IT? OK NO! It's o’clock A quarter past
WHAT’S THE TİME ? – WHAT TİME İS İT ?
Keypad Source: under under
Numbers
Keypad Source: under under
CLICK THE NUMBERS IN SEQUENCE
What’s the time?
Look at the clock. Thirteen One Fourteen Two Fifteen Three Sixteen
Objective & Essential Understanding
Presentation Title Presentation Title
Beginning Decimals.
What time is it ? o’clock / half past 2B: Unit 5.
STRIKE THE NUMBER! PLAY.
MATHS TIME! nine ten eleven fifteen eight
MINUTES five past ten past quarter past 11 1 twenty past
CLICK THE NUMBERS IN SEQUENCE
LCD AND KEYBOARD INTERFACING
TIME PAST O’CLOCK TO HALF TO HALF O’CLOCK PAST.
Multiplication facts Your Help Guide.
3,050,020 = 3,000, Write the number in words. 6,140,050 = 6,000, ,
Beginning Decimals.
Three o’clock Half past three Half past one Ten o’clock
What’s the time? CLICK ON THE CLOCK.
Presentation transcript:

ECE 447: Lecture 12 Keypads ECE 447: Lecture 10

ECE 447: Matrix Keypad

ECE 447: Matrix Keypad Microcontroller Interface

ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning PC0 PC1 PC2 PC3 PC4 PC5 PC6 ECE 447: Matrix Keypad - Scanning

F0 inputs outputs ECE 447: Matrix Key Codes

while (1) { do ( PORTC = "XXXX0000" while ( PORTC = "X111XXXX"); c=decode_key();..... do something dependent on the key being pressed... PORTC = "XXXX0000" while (PORTC != "X111XXXX") /* do nothing */ } Wait until any key pressed Wait until all keys released Decode the key being pressed ECE 447: Key Scanning Function

int decode_key() { PORTC = "XXXX1110" if ( PORTC != "X111XXXX”) return decode_output (PORTC, 1) else { PORTC = "XXXX1101" if ( PORTC != "X111XXXX") return decode_output(PORTC, 2) } else { PORTC = "XXXX1011" if ( PORTC != "X111XXXX") return decode_output (PORTC, 3) } else { PORTC = "XXXX0111" if ( PORTC != "X111XXXX") return decode_output (PORTC, 4) else return NONE_KEY_PRESSED; } check Row 1 check Row 2 check Row 3 check Row 4 ECE 447: Key Scanning Function

Possible Key Decoding Procedure (3) Decoding a column XCCCXXXX Three bits of interest Three combinations valid (“110”, “101”, “011”) Decoding column possible ECE 447: Key Scanning Function

F0 inputs ECE 447: Matrix Key Codes

F0 outputs ECE 447: Matrix Key Codes

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

Matrix Keypad - Scanning outputs inputs ECE 447: Matrix Keypad - Scanning

decode_key() { unsigned char keys = [NONE, ONE, TWO, …, TWELVE]; for (i=0, i<=12, i++) { PORTC = keys[i] if (PORTC == keys[i] return i; } return UNKNOWN; } Simplified Key Decoding Procedure (4) ECE 447: Key Scanning Function – Alternative

F0 ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN ELEVEN TWELVE NONE ECE 447: Matrix Key Codes

while (1) { do ( PORTC = "XXXX0000" while ( PORTC = "X111XXXX"); c=decode_key();..... do something dependent on the key being pressed... PORTC = "XXXX0000" while (PORTC != "X111XXXX") /* do nothing */ } Wait until any key pressed Wait until all keys released Decode the key being pressed ECE 447: Key Scanning Function – No Debounce

Key Bouncing key bounce, t BOUNCE typically, t BOUNCE < 10 ms key bounce, t BOUNCE ECE 447: Key Bounce

Keypad Bouncing key bounce, t BOUNCE typically, t BOUNCE < 10 ms key bounce, t BOUNCE NONE ECE 447: Key Bounce

Keypad Debouncing in Software key bounce, t BOUNCE typically, t BOUNCE < 10 ms wait debouncing period key bounce, t BOUNCE decode_key; action dependent on the key wait until any key pressed wait debouncing period wait until all keys released wait until any key pressed NONE ECE 447: Key Bounce

Key Decoding Procedure (7) while (1) { while (key_decode() == NONE) /* do nothing */ ; wait debouncing period(); c=decode_key();..... do something dependent on the key being pressed... while(key_decode()!=NONE) /* do nothing */ ; wait debouncing period(); } Wait until any key pressed Wait until all keys released Decode the key being pressed ECE 447: Key Scanning Function – with Debounce

2 out of 7 Keypad C ECE 447: 2 of 7 Keypad

ECE 447: 2 of 7 Keypad Microcontroller Interface

C 0 ECE 447: 2 of 7 Keypad Scanning

2 out of 7 Keypad - Scanning C ECE 447: 2 of 7 Keypad Scanning

decode_key() { unsigned char keys = [NONE, ONE, TWO, …, TWELVE]; for (i=0, i<=12, i++) { PORTC = keys[i] if (PORTC == keys[i] return i; } return UNKNOWN; } ECE 447: 2 of 7 Keypad Scanning Function

ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN ELEVEN TWELVE NONE ECE 447: 2 of 7 Key Codes

ECE 447: 2 of 7 Keypad Microcontroller Interface

decode_key() { unsigned char keys = [NONE, ONE, TWO, …, TWELVE]; code = PORTC for (i=0, i<=12, i++) { if (code == keys[i] return i; } return UNKNOWN; } ECE 447: 2 of 7 Keypad Scanning Function (Simplified)

while (1) { while (decode_key() == NONE) /* do nothing */ ; wait debouncing period(); c=decode_key();..... do something dependent on the key being pressed... while(decode_key()!=NONE) /* do nothing */ ; wait debouncing period(); } Wait until any key pressed Wait until all keys released Decode the key being pressed ECE 447: 2 of 7 Keypad Scanning Function

Key Debouncing in Hardware ECE 447: 2 of 7 Keypad Hardware Debounce

Key Debouncing in Hardware ECE 447: 2 of 7 Keypad Hardware Debounce Capacitors associated with all pull-up resistors