====== Basys 3 Keyboard Demo ====== {{:nexys4-ddr:n4k.png?nolink&600|}} ===== 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 ===== * Basys 3 with a MicroUSB Programming Cable * Vivado installation compatible with the latest release of this demo (2022.1) * //See [[programmable-logic:guides:installing-vivado-and-vitis|Installing Vivado, Vitis, and Digilent Board Files]] for installation instructions.// * Serial Terminal application to receive messages printed by the demo * //See [[programmable-logic:guides:serial-terminals:start]] for more information.// * USB Keyboard ---- ===== 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 ^ | @#C0EEBD: Keyboard/2022.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/Keyboard/2022.1-1/Basys-3-Keyboard-hw.xpr.zip}} | See //Using the Latest Release//, below | | Keyboard/2021.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/Keyboard/2021.1-1/Basys-3-Keyboard-hw.xpr.zip}} | See //Using the Latest Release//, below | | Keyboard/2020.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/Keyboard/2020.1-1/Basys-3-Keyboard-hw.xpr.zip}} | See //Using the Latest Release//, below | | v2018.2-3 | [[https://github.com/Digilent/Basys-3-Keyboard/releases/tag/v2018.2-3|Release ZIP downloads]] | [[https://github.com/Digilent/Basys-3-Keyboard/tree/v2018.2-3| v2018.2-3 Github README]] | | v2018.2-2 | [[https://github.com/Digilent/Basys-3-Keyboard/releases/tag/v2018.2-2|Release ZIP downloads]] | [[https://github.com/Digilent/Basys-3-Keyboard/tree/v2018.2-2| v2018.2-2 Github README]] | | v2018.2-1 | [[https://github.com/Digilent/Basys-3-Keyboard/releases/tag/v2018.2-1|Release ZIP downloads]] | [[https://github.com/Digilent/Basys-3-Keyboard/tree/v2018.2-1| v2018.2-1 Github README]] | **Note for Advanced Users:** //GitHub sources for this demo can be found in the [[https://github.com/digilent/Basys-3/tree/Keyboard/master|Keyboard/master]] branch of the Basys-3 repository. Further documentation on the structure of this repository can be found on this wiki's [[programmable-logic:documents:git]] page.// ---- Instructions on the use of the latest release can be found in this dropdown: --> Using the Latest Release #^ {{page>programmable-logic:guides:using-github-releases#hardware_only_release_before_programming&noheader}} --> Set up the Basys 3 # Plug the Basys 3 into the computer using the microUSB cable. Also plug the keyboard into the Basys 3. ---- <-- {{page>programmable-logic:guides:using-github-releases#hardware_only_release_programming&noheader}} At this point, the demo is now running on your board. Refer to the [[#description|Description]] and [[#functionality|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. > >{{:learn:programmable-logic:tutorials:basys-3-keyboard-demo:keypress.jpg?nolink&500|}} ==== 2. Key Release ==== >When the 'a' key is released, a scan code of "F0 1C" is sent over UART. > >{{:learn:programmable-logic:tutorials:basys-3-keyboard-demo:keyrelease.jpg?nolink&500|}} ==== 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"). > >{{:learn:programmable-logic:tutorials:basys-3-keyboard-demo:twokey.jpg?nolink&500|}} ===== Additional Resources ===== All materials related to the use of the Basys 3 can be found on its [[..:start|Resource Center]]. For a walkthrough of the process of creating a simple HDL project in Vivado, see [[programmable-logic:guides:getting-started-with-vivado]]. 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 [[https://forum.digilent.com/forum/4-fpga/|FPGA]] section of the Digilent Forum.