Lab 3

horizontal rule

ece533 | doering | ece labs | ece | rhit

Home
Course Documents
Homework
Labs
Resources

PS/2 Port Keyboard Interface and Display

Introduction

In this lab you will learn about the PS/2 port protocol, and develop an interface module for PS/2 keyboards that you can use with other designs. In addition, you will develop a FIFO (first-in, first-out) memory that can be used to display the keyboard scan codes at a fixed rate.

Objectives

bullet

Learn about PS/2 port data protocol and timing for keyboards

bullet

Create your own IP module for a PS/2 keyboard interface

bullet

Create your own FIFO module

bullet

Create a top-level design that displays PS/2 scan codes on the seven-segment digit display at a fixed rate

bullet

Follow good design practice with simulation, i.e., do functional verification for each major module independently, then do verification for the entire system

Software

bullet

NC-Sim or ModelSim Verilog behavioral simulator

bullet

Xilinx WebPack ISE 6.3 FPGA implementation tools

Equipment

bullet

AT-style keyboard with PS/2 interface connector

bullet

Digilent D2SB/DIO4 board combination

bullet

Parallel port cable

bullet

DC power supply

Documents

bullet

PS/2 Mouse/Keyboard Protocol: http://www.computer-engineering.org/ps2protocol/

bullet

The AT-PS/2 Keyboard Interface: http://www.computer-engineering.org/ps2keyboard/

bullet

Interfacing the AT Keyboard: http://www.beyondlogic.org/keyboard/keybrd.htm

bullet

ePanorama PC Hardware Page: http://www.epanorama.net/links/pc/index.html. Look for "Interfaces," then "Keyboard".

bullet

PLD Oasis > Tutorials/Documents > Synthesis Design Rules

bullet

PLD Oasis > Hardware > Local Guide for Digilent board > Look for "Verilog Modules" section

Activities

NOTE 1: Your design must use of the "datapath / controller" architecture style in at least one module, i.e., use a finite-state machine as a controller of data processing elements.

NOTE 2: Your design must conform to ALL of the Synthesis Design Rules, including the naming conventions at the bottom of the document.

  1. Review the "Verilog Modules" section of Local Guide for Digilent board to learn about two IP modules that I have designed to operate the four-digit display on D2SB/DIO4 (and D2E/DIO1) boards. Use either "DigitDisplay" or "LED7_Display" as your interface to the four-digit display.

  2. Learn about PS/2 data protocol and signal timing in the documents above.

  3. Create a stand-alone PS/2 interface module that can be reused in other designs. The module will accept the PS/2 clock and data signals as input, and produce the keyboard scan code byte as output. The output must be synchronized to the master clock (use the D2SB oscillator) and a "data ready" signal will assert high for one clock cycle when a new scan code is ready. The output must be stable even when a scan code is being read by your module.

  4. Obtain representative waveforms of the PS/2 port from the mixed-signal oscilloscope. Use these waveforms as the basis for a testbench for your PS/2 module. You must create a Verilog "task" that accepts a scan code as an input parameter and produces the correct set of PS/2 data and clock waveforms as output. Look at "taskdemo.v" at PLD Oasis Verilog Examples for a model.

  5. Verify the functionality of your PS/2 interface module with your testbench.

  6. Create a stand-alone FIFO (first-in first-out) memory that will accept scan codes at an arbitrary rate from the PS/2 interface module, and will output the codes at a fixed rate of, say, one or two codes per second. Consider using the block RAM on the Spartan-2E FPGA. The "Registered Dual-Port RAM" may be useful here. [more information forthcoming on this part...]

  7. Create a testbench for the FIFO and verify its functionality. You must do this independently of the PS/2 testbench.

  8. Create a top-level module that instantiates your PS/2 interface, the FIFO, and two seven-segment display drivers.

  9. Create a testbench for your top-level module and verify the functionality of your complete system.

  10. Confirm that your design works properly on the D2SB board.

Deliverables

  1. I/O block diagrams for your PS/2 and FIFO modules, and the top-level module

  2. System block diagram for your top-level module

  3. Hardcopy of mixed-signal oscilloscope PS/2 waveforms

  4. Waveform plots of each of your three functional verifications (include annotations to explain your simulation results)

  5. Hardcopy of all Verilog .v files produced

  6. Memo detailing your design process and results. Describe the operating principles of your PS/2 and FIFO modules.

  7. Demonstration of your design to instructor (obtain initials)

Due Date

Beginning of lab two week's from today

 

horizontal rule

Home | Course Documents | Homework | Labs | Resources

 ECE533: Programmable Logic Systems Design (S 2004-05)
Department of Electrical and Computer Engineering
Rose-Hulman Institute of Technology


For questions or comments regarding this web contact:
Last updated: 03/10/05.