Genesys 2 Keyboard Demo

Overview

Features Used

Not Used Used
8 User Switches X
8 User LEDs X
6 User Push Buttons X
128×32 Monochrome OLED Display X
USB-UART Bridge X
Fully Bonded 400-pin FMC HPC Connector X
Micro SD Card Connector X
HDMI Sink and HDMI Source X
VGA Connector X
Two four-lane DisplayPort Connectors X
Audio Codec w/ Four 3.5mm Jacks X
10/100/1000 Ethernet PHY X
1GiB 1800Mt/s DDR3 Memory X
Serial Flash X
Five Pmod Ports X
Pmod for XADC Signals X
USB HID Host X
USB 2.0 Host/Device/OTG PHY X

Description

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

* The user presses a key on the keyboard, this sends a keyboard scan code to the Genesys2. This scan code is read and transmitted to a terminal application via the USB-UART bridge. When a new scan code is read, it is shifted into the ASCII string from the right. A scan code of F0xx indicates that key xx has been released.

——-

Prerequisites

Skills

  • Basic familiarity with Vivado
    • This experience can be found by walking through our “Getting Started with Vivado” guide

Hardware

  • Genesys2 FPGA board
  • Micro-USB cable
  • USB Keyboard

Software

  • Vivado Design Suite 2016.X
    • Newer/older versions can be used, but the procedure may vary slightly

Downloads

Genesys2 Support Repository – ZIP GIT Repo


How to...

1. Generate the Project

1.1) Download the repository linked in the download section and place it in the location of your choosing.
1.2) Generate the Keyboard project within the “Projects” folder by following this guide before continuing: How to Generate a Project from Digilent's Github

2. Build the Project

2.1) Click Generate Bitstream on the left hand menu towards the bottom. Vivado will run through both Run Synthesis and Run Implementation before it generates the bitstream automatically.

Note: If you want, you can click each step by itself in the order of Run Synthesis, Run Implementation and then Generate Bitstream.

3. Set Up the Board

3.1) Ensure that your board is plugged into a 12 Volt power supply, connected to your computer via two MicroUSB cables attached to the JTAG and UART ports, and connected to a USB keyboard via the uppermost of the two USB ports.

4. Program the Board

4.1) Once you have generated your bit file, Click on the hardware manager and connect to your board by choosing the local server option.

4.2) Click program to load the project onto your Genesys2.

5. Run the Project

This portion will help you run the demo and observe all its features.

5.1) Terminal Setup

Connect to your board by opening the associated COM port. Then set up your terminal for 8 bit data, a baud rate of 9600, no parity bit, and one stop bit.

5.2) 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.

5.3) Key Release

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

5.4) Multi key press

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