Presentation is loading. Please wait.

Presentation is loading. Please wait.

Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE 5330 11/17/2008.

Similar presentations


Presentation on theme: "Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE 5330 11/17/2008."— Presentation transcript:

1 Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE 5330 11/17/2008

2 Requirements Software Requirements Software Requirements C language using Codevision C language using Codevision Hardware Requirements Hardware Requirements 4x4 Keypad 4x4 Keypad 7 Segment Display 7 Segment Display N-channel Enhancement Mode MOSFETs N-channel Enhancement Mode MOSFETs Resistors Resistors Interfaces Interfaces Engineer Keypad Interface to AVR Engineer Keypad Interface to AVR Engineer LED Interface to AVR Engineer LED Interface to AVR Integrate Keypad and LED for system functionality Integrate Keypad and LED for system functionality

3 AVR Pin Layout

4 Keypad Setup “Scanning the Keypad” “Scanning the Keypad” The keypad contains 16 keys, symmetrically arranged in four rows with four keys, each. Each column and row of the keypad is connected to an I/O pin. The keypad contains 16 keys, symmetrically arranged in four rows with four keys, each. Each column and row of the keypad is connected to an I/O pin. Make the columns as i/p and drive the rows making them o/p, this whole procedure of reading the keyboard is called scanning. Make the columns as i/p and drive the rows making them o/p, this whole procedure of reading the keyboard is called scanning. The microcontroller continually scans the keypad by setting all row pins except one to high and reading all column pins. All column inputs have pull-up resistors enables so when a key is pressed the microcontroller will record a low level on one of the column inputs. The microcontroller continually scans the keypad by setting all row pins except one to high and reading all column pins. All column inputs have pull-up resistors enables so when a key is pressed the microcontroller will record a low level on one of the column inputs.

5 Keypad Layout

6 General Coding for Keypad Within Interrupt Routine Within Interrupt Routine Timer value yet to be determined Timer value yet to be determined Could be Approximately 20ms Could be Approximately 20ms Port A.0 – A.3 will be continually driven by shifting a bit Port A.0 – A.3 will be continually driven by shifting a bit 0001  0010  0100  1000 0001  0010  0100  1000 Read Port A.4 – A.7 (column reading) Read Port A.4 – A.7 (column reading) Determine which button is pushed Determine which button is pushed A 50ms Key debounce technique will be implemented A 50ms Key debounce technique will be implemented Eliminate Multiple Keystrokes Eliminate Multiple Keystrokes

7 7-Segment Display Setup Display is broken up into 4 sections (A, B, C, D) Display is broken up into 4 sections (A, B, C, D) Port C (0-3) will be connected to pins (4,7,10,14) respectively. Each will have a current limiting MOSFET connected to ground. Port C (0-3) will be connected to pins (4,7,10,14) respectively. Each will have a current limiting MOSFET connected to ground. Pins(1,3,8,10,12,13,15,16) each connected to 200 ohm resistors Pins(1,3,8,10,12,13,15,16) each connected to 200 ohm resistors

8 General Coding for Display Two Steps in Coding Two Steps in Coding 1. Determine what section (A,B,C,D) the value is to be displayed 1. Determine what section (A,B,C,D) the value is to be displayed Suppose Section D is turned on: Suppose Section D is turned on: PINC.3 will be high PINC.3 will be high 2. Display the corresponding value from the keypad button pushed 2. Display the corresponding value from the keypad button pushed Requires a “look-up” table to be developed Requires a “look-up” table to be developed If 1 is displayed If 1 is displayed Port B (0-7) would be set as: 00010100 Port B (0-7) would be set as: 00010100

9 Functionality Display Alpha and Numeric Characters Display Alpha and Numeric Characters Integer Addition and Subtraction Integer Addition and Subtraction Home Security Home Security Table of Security Codes will be provided Table of Security Codes will be provided User will enter a correct code User will enter a correct code Display will read OPEN Display will read OPEN User will enter an incorrect code User will enter an incorrect code Display will read BAD Display will read BAD CODING FOR BOTH FUNCTIONALITY AND INTERFACE INTEGRATION IS NON-TRIVIAL


Download ppt "Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE 5330 11/17/2008."

Similar presentations


Ads by Google