Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
programmable-logic:nexys-video:demos:axi-ps2 [2022/09/12 13:58] – changed forum.digilentinc.com to forum.digilent.com Jeffreyprogrammable-logic:nexys-video:demos:axi-ps2 [2023/08/24 23:46] (current) – Move to direct file links for downloads Arthur Brown
Line 1: Line 1:
 +====== Nexys Video AXI PS/2 Keyboard Demo ======
  
 +<WRAP round todo>
 +=== Under Construction ===
 +</WRAP>
 +
 +{{nexys/nexysvideo/16508527298_efc2312db1_o_1_.png?600}}
 +
 +----
 +===== Description =====
 +
 +This project demonstrates how to use the Nexys Video's USB HID Host port and USB UART bridge with Microblaze. A custom AXI core is used to control interpret data received (and send data to) the board's USB HID port through a PS/2 interface. Vivado is used to build the demo's hardware platform, and Vitis is used to program the bitstream onto the board and to build and deploy a C application. When programmed onto the board, whenever the user presses a key on a keyboard connected to the USB HID port (J15, labeled "USB HOST"), a scan code is sent to the FPGA through a PS/2 interface. This scan code is read, converted to ASCII, and transmitted to the computer via the USB-UART bridge. In practice, this means that keys pressed on the keyboard connected to the Nexys Video are echoed over the serial connection.
 +
 +To use this demo, the Nexys Video must be connected to a computer over MicroUSB, which must be running a serial terminal such as Tera Term or PuTTY.
 +
 +----
 +===== Inventory =====
 +
 +  * Nexys Video
 +  * USB Keyboard
 +  * MicroUSB cables for programming and serial communication
 +  * External power supply
 +  * Vivado and Vitis installations 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.//
 +
 +----
 +===== 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 Xilinx tools (Vivado and Vitis) version 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: PS2/2022.1-1  | {{https://github.com/Digilent/Nexys-Video/releases/download/PS2/2022.1-1/Nexys-Video-AXI-PS2-Keyboard-hw.xpr.zip}} \\ {{https://github.com/Digilent/Nexys-Video/releases/download/PS2/2022.1-1/Nexys-Video-AXI-PS2-Keyboard-sw.ide.zip}}  | See //Using the Latest Release//, below  |
 +| PS2/2021.1-1            | {{https://github.com/Digilent/Nexys-Video/releases/download/PS2/2021.1-1/Nexys-Video-AXI-PS2-Keyboard-hw.xpr.zip}} \\ {{https://github.com/Digilent/Nexys-Video/releases/download/PS2/2021.1-1/Nexys-Video-AXI-PS2-Keyboard-sw.ide.zip}}  | See //Using the Latest Release//, below  |
 +| PS2/2020.1-1            | {{https://github.com/Digilent/Nexys-Video/releases/download/PS2/2020.1-1/Nexys-Video-AXI-PS2-Keyboard-hw.xpr.zip}} \\ {{https://github.com/Digilent/Nexys-Video/releases/download/PS2/2020.1-1/Nexys-Video-AXI-PS2-Keyboard-sw.ide.zip}}  | See //Using the Latest Release//, below  |
 +| v2018.2-1               | [[https://github.com/Digilent/Nexys-Video-AXI-PS2-Keyboard/releases/tag/v2018.2-1|Release ZIP Downloads]]  | [[https://github.com/Digilent/Nexys-Video-AXI-PS2-Keyboard/tree/v2018.2-1|v2018.2-1 README]]  |
 +
 +**Note for Advanced Users:** //GitHub sources for this demo can be found in the [[https://github.com/digilent/nexys-video/tree/PS2/master|PS2/master]] branch of the Nexys-Video 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 #^
 +<WRAP group>
 +
 +{{page>programmable-logic:guides:using-github-releases#baremetal_release_before_programming&noheader}}
 +
 +--> Set up the Nexys Video #
 +<WRAP group> <WRAP column half>
 +Plug the Nexys Video into the computer via the MicroUSB programming cables (one for communication, one for programming). Plug the power supply into the board and power the board on by flipping the power switch. Connect the USB keyboard.
 +
 +Connect a serial terminal to the port associated with the Nexys Video. The demo uses the AXI UART-Lite IP's default baud rate of **9600**.
 +</WRAP> <WRAP column half>
 +{{learn/programmable-logic/tutorials/2020.1/launch-vitis-application/set-baud.png?600}}
 +</WRAP> </WRAP>
 +----
 +<--
 +
 +{{page>programmable-logic:guides:using-github-releases#baremetal_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.
 +----
 +Additional steps beyond here present how you can use the other archive provided in the release, containing the hardware project, to rebuild the Vivado project, and use a newly exported XSA file to update the platform in Vitis.
 +----
 +{{page>programmable-logic:guides:using-github-releases#baremetal_update_specification&noheader}}
 +
 +</WRAP>
 +<--
 +
 +----
 +===== Functionality =====
 +
 +<WRAP group> <WRAP column half>
 +Upon launch, the three keyboard LEDs - Caps Lock, Num Lock, and Scroll Lock will flash and a message appears on the terminal.
 +</WRAP> <WRAP column half>
 +{{:learn:programmable-logic:tutorials:nexys-video-axi-ps2-keyboard:example1.jpg}}
 +</WRAP> </WRAP>
 +----
 +<WRAP group> <WRAP column half>
 +The way the project works is pretty simple. When a button is pressed, it's corresponding make code - when pressed - and break code - when released - is received by the software and interpreted. After the interpretation is done, the corresponding character is sent via UART to the terminal and displayed.
 +</WRAP> <WRAP column half>
 +{{:learn:programmable-logic:tutorials:nexys-video-axi-ps2-keyboard:example2.jpg}}
 +</WRAP> </WRAP>
 +----
 +<WRAP group> <WRAP column half>
 +Most of the keyboard buttons have been implemented at least to some degree. All of the alphabet letters including uppercase are working. Uppercase can be set either by using any of the shift buttons or by pressing the caps-lock button.
 +
 +The numbers 0-9 are also implemented however the special characters are not.
 +
 +When keys that have not been implemented are pressed, "Unknown Key!!" is displayed on the terminal. Depending on the key, this text can be accompanied by misinterpreted key codes since some keys may produce longer make/break codes than others which can lead to identification errors.
 +</WRAP> <WRAP column half>
 +{{:learn:programmable-logic:tutorials:nexys-video-axi-ps2-keyboard:example3.jpg}}
 +</WRAP> </WRAP>
 +<WRAP group> <WRAP column half>
 +As an example, the output for "Page Down" button can be seen to the right:
 +</WRAP> <WRAP column half>
 +{{:learn:programmable-logic:tutorials:nexys-video-axi-ps2-keyboard:example4.jpg}}
 +</WRAP> </WRAP>
 +
 +----
 +===== Additional Resources =====
 +
 +All materials related to the use of the Nexys Video can be found on its [[..:|Resource Center]].
 +
 +For a walkthrough of the process of creating a simple baremetal software project in Vivado and Vitis, see [[programmable-logic:guides:getting-started-with-ipi]]. Information on important parts of the GUIs, 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.
 +
 +----
 +<code>{{tag>project zybo-z7}}</code>