This is an old revision of the document!


Basys 3 Keyboard Demo

Under Construction

Description

The Keyboard Demo project demonstrates a simple usage of the Basys3's USB-HID and USB-UART ports. The behavior is as follows:

  • The user presses a key on the keyboard, this sends a keyboard PS/2 scan code to the Basys3 over the USB-HID port. This scan code is read and transmitted to a terminal application via the USB-UART bridge. When the key is released, a scan code of F0XX is transmitted, indicating that the key with PS/2 code XX has been released.

Inventory


Download and Usage Instructions

First and foremost, releases - consisting of a set of files for download - are only compatible with a specific version of the Xilinx tools, as specified in the name of the release (referred to as a release tag). In addition, releases are only compatible with the specified variant of the board. For example, a release tagged “20/DMA/2020.1” for the Zybo Z7 is only to be used with the -20 variant of the board and Vivado 2020.1.

The latest release version for this demo is highlighted in green.

Note: Releases for FPGA demos from before 2020.1 used a different git structure, and used a different release tag naming scheme.

Release Tag Release Downloads Setup Instructions
Keyboard/2020.1-1 Release ZIP Downloads See Using the Latest Release, below
v2018.2-3 Release ZIP downloads v2018.2-3 Github README
v2018.2-2 Release ZIP downloads v2018.2-2 Github README
v2018.2-1 Release ZIP downloads v2018.2-1 Github README

Note for Advanced Users: All demos for the Basys 3 are provided through the Basys-3 repository on Github. Further documentation on the structure of this repository can be found on this wiki's Digilent FPGA Demo Git Repositories (Redirect) page.


Instructions on the use of the latest release can be found in this dropdown:

Using the Latest Release
This page has been moved, the new location is Using a Digilent FPGA Github Demo's Releases (2020.1).
Set up the Basys 3
Plug the Basys 3 into the computer using the microUSB cable. Also plug the keyboard into the Basys 3.
This page has been moved, the new location is Using a Digilent FPGA Github Demo's Releases (2020.1).

At this point, the demo is now running on your board. Refer to the Description and Functionality sections of this document for more information on what it does.


Functionality

1. Key Press

When a button is pressed, the value of the scan code will be converted to ASCII and transmitted to the terminal. In the picture, 'a' is pressed, so a scan code of “1C” is sent to the terminal. The expected scan code for each key can be found in the keyboard diagram at the top of this guide.

2. Key Release

When the 'a' key is released, a scan code of “F0 1C” is sent over UART.

3. Multiple Key Presses

When multiple keys are pressed their scan codes are sent over UART in order. In this case, Q (“15”) was pressed, followed by W (“1D”).

Additional Resources

All materials related to the use of the Basys 3 can be found on its Resource Center.

For a walkthrough of the process of creating a simple HDL project in Vivado, see Getting Started with Vivado for Hardware-Only Designs (Redirect). Information on important parts of the GUI, and indirect discussion of the steps required to modify, rebuild, and run this demo in hardware can also be found here.

For technical support, please visit the FPGA section of the Digilent Forum.

{{tag>project basys-3}}