LAB 2: Hardware Interfacing – KeypadCEG 3136 - Computer Architecture II Fall 2018School of Engineering and Computer ScienceUniversity of Ottawa LAB 2: Hardware Interfacing – KeypadCEG 3136 - Computer Architecture II Fall 2018School of Engineering and Computer ScienceUniversity of Ottawa Experiment Date: 01/10/2018Submission Date: 15/10/2018OBJECTIVES● To familiarize oursel
...[Show More]
LAB 2: Hardware Interfacing – Keypad
CEG 3136 - Computer Architecture II Fall 2018
School of Engineering and Computer Science
University of Ottawa
LAB 2: Hardware Interfacing – Keypad
CEG 3136 - Computer Architecture II Fall 2018
School of Engineering and Computer Science
University of Ottawa
Experiment Date: 01/10/2018
Submission Date: 15/10/2018
OBJECTIVES
● To familiarize ourselves with the Motorola 9S12DG256.
● To implement a basic keypad unit.
MATERIALS AND COMPONENTS
● Windows PC
● MiniIDE software
● Dragon-12 board and associated cables
INTRODUCTION
The purpose of this lab is to implement a connection between the keypad of a Dragon-12 board and an arming/disarming system. This employs concepts we familiarize ourselves with during the previous lab.
DESIGN
Part 1
To implement KeyPad.asm, we have to consider what it does. It must take in which key on the Dragon-12 keypad as input and manipulate its corresponding ASCII value.
The subroutine pollReadKey checks for key presses on the Dragon-12 and converts to ASCII if so.
The subroutine readKey takes the associated value of keys pressed on the Dragon-12, but it also accounts for faulty presses and brief taps with a delay beforehand.
The readKeyCode subroutine involves three nested conditional statements for the four rows on the keypad. The logic behind this employs the understanding that each row on the keypad should detect key presses for a moment, and if one is pressed, indicate which key. Finally, the subroutine returns the changed PORTA value.
The simplest yet most time-consuming subroutine is translate, which takes the value from the previous subroutine and translates it to the corresponding and necessary ASCII code. This is achieved with many conditional statements.
[Show Less]