The Keyboard Demo project demonstrates a simple usage of the Nexys 4 DDR's USB-HID port and 7 segment display. The behavior is as follows:
* The user presses a key on the keyboard, which sends a keyboard scan code to the Nexys 4 DDR. This scan code is read and output onto the 7 segment display. When a new scan code is read, it is shifted onto the 7 segment display from the right. A scan code of F0xx indicates that key xx has been released.
| Not Used | Used | |
|---|---|---|
| 16 user switches | X | |
| 16 user LEDs | X | |
| Two tri-color LEDs | X | |
| 5 User Push Buttons | X | |
| Two 4-digit 7-segment displays | X | |
| 4 Pmod ports | X | |
| Pmod for XADC signals | X | |
| 16-bit VGA output | X | |
| USB-UART Bridge | X | |
| Serial Flash for Application Data | X | |
| USB HID Host With Mouse | X | |
| USB HID Host With Keyboard | X | |
| Micro SD card connector | X | |
| PWM audio output | X | |
| PDM microphone | X | |
| 3-axis accelerometer | X | |
| 128MiB DDR2 | X | |
| Temperature sensor | X | |
| 10/100 Ethernet PHY | X |
—–
Nexys 4 DDR Keyboard Project Repository – ZIP Archive GIT Repo
1) Follow the Using Digilent Github Demo Projects Tutorial. This is an HDL design project, and as such does not support Vivado SDK, select the tutorial options appropriate for a Vivado-only design. Return to this guide when prompted to check for extra hardware requirements and setup.
2) Plug your USB Keyboard into the USB HOST port on your Nexys 4 DDR, then return to the Github Projects Tutorial to finish programming and running the demo.
Initially, the 7 segment display will show all 0's
When a button is pressed, the value of the scan code will shift onto the 7 segment display. In the picture, 'a' is pressed, so a scan code of “1C” is displayed.
>When the 'a' key is released, a scan code of “F01C” is shifted onto the 7 segment display. The initial scan code of “1C” is shifted to the left display.
When multiple keys are pressed their scan codes are shifted in order. In this case, Q (“15”) was pressed, followed by W (“1D”).