DOC PREVIEW
U of U CS 5780 - Gadfly Keypad Interface

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ObjectivesReadingBackgroundPartsSoftwareTasksPrelabWriteupCS/ECE 5780/6780 Lab #4Spring 2009RegehrLAB #4: Gadfly Keypad InterfaceLab writeup is due to your TA at the beginning of your next scheduled lab. Don’t put this off to the lastminute! There is pre-lab work to complete before the start of the next lab. NO LATE LAB REPORTSWILL BE ACCEPTED.1 Objectives• Design the hardware interface between a keypad and microcomputer.• Create the low-level gadfly device driver that can be used in other applications.• Design the hardware interface between a microcomputer and LEDs.• Implement keypad security system.2 Reading• Read 3.1-3.5 and 8.1 in the textbook.• Read the keypad datasheet.3 BackgroundTwo versions of the keypad interface will be designed. In this lab, you will use gadfly synchronization. Inthe next lab, you will redesign it using interrupts. This lab demonstrates how a microcomputer can be usedto control a keypad matrix via a parallel interface. Your low-level software should input, scan, debounce,and save keystrokes. It should also handle two key rollover. For example, if I type “1,2,3”, I may push “1”,push “2”, release “1”, push “3”, release “2”, then release “3”.Once again, make sure the USER option jumpers have been disabled for this lab. It is recommendedthat you use Port T as the interface to your keypad, as it contains an internal pull-up, pull-down network.4 PartsThis lab will require a 12-key matrix keypad (Grayhill 96AB2-102-R) which you can purchase in the ECElab.5 SoftwareBelow is a prototype for your device driver:Lab #4, Page 21. Data structures: global, private (accessed only by device driver, not the user)OpenFlag - Boolean that is true if the keyboard port is open, initially false, set to true by KeyOpen, setto false by KeyClose, should be in static storage.2. Initialization routines (called by user)KeyOpen - Initialization of the keyboard port, sets OpenFlag to true, initializes the hardware (timers,interrupts, etc.), returns error code if unsuccessful (hardware non-existent, already open, etc.), noinput parameters, output parameter is error code.KeyClose - release of keyboard port, sets OpenFlag to false, returns error code if not previouslyopen.3. Regular I/O calls (called by user to perform I/O)KeyIn - input a key value from the keyboard port, waits for key to be pressed, then waits for it to bereleased, should support debouncing and two key rollover, returns data if successful, returns errorcode if unsuccessful (device not open, etc.).6 Tasks1. Prepare a schematic for your design including all components used (note, if you do not use Port T,then you will need pull-up resistors on all the keypad inputs).2. Write your low-level keypad device driver.3. Write a main program which is an access code based security system. You should modify and usethe FSM for the security code access system that you designed in lab 3. You will need to make thefollowing modifications:(a) Each access code now will consist of 4 digits between 0-9 which will be checked against anaccess code specified in global memory. The * key will be used as reset.(b) The keypad will now be used to enter these digits.4. Connect your circuit and debug your software. Check off your working system with your TA.5. Use a scope to measure the bounce time and verify the sharpness of the digital inputs/outputs.7 PrelabComplete tasks 1-3 before you come to lab.8 Writeup1. Your hardware schematic.2. A printout of your code.3. Present your bounce time measurements (and waveforms if you desire). Describe the techniqueyou used to debounce the switch and why this method is effective based on your


View Full Document

U of U CS 5780 - Gadfly Keypad Interface

Documents in this Course
Lab 1

Lab 1

5 pages

FIFOs

FIFOs

10 pages

FIFOs

FIFOs

5 pages

FIFO’s

FIFO’s

12 pages

MCU Ports

MCU Ports

12 pages

Serial IO

Serial IO

26 pages

Load more
Download Gadfly Keypad Interface
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Gadfly Keypad Interface and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Gadfly Keypad Interface 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?