====== Basys 3 General I/O Demo ====== {{:basys3:basic_edit.jpg?500|}} ---- ===== Description ===== This demo contains a Vivado project which uses the Basys 3's switches, LEDs, pushbuttons, seven-segment display, VGA connector, USB HID Host port and USB UART bridge, written in VHDL: * When programmed onto the board, all sixteen of the switches are tied to their corresponding LEDs. Every time a switch is toggled, the LED directly above it will toggle with it. * A computer monitor attached to the Basys 3 with a VGA cable displays a series of moving patterns. If a mouse is attached to the USB port when the demo starts running, a cursor is displayed on the screen and can be moved with the mouse. * The seven segment display counts up from 0 to 9 as long as no buttons are pressed. As long as BTNU is pressed, the first digit on the seven segment display is turned off. In the same manner, BTNL turns off the second digit, BTNR turns off the third, and BTND turns off the fourth. BTNC turns off the entire display and resets the counter. * Whenever the reset button or BTNC is pressed, the Basys 3 sends the line “BASYS3 GPIO/UART DEMO!” to the serial terminal. Whenever one of the D-pad buttons other than BTNC is pressed, the line “Button press detected!” is sent. ---- ===== Inventory ===== * Basys 3 with a MicroUSB Programming Cable * Vivado installation compatible with the latest release of this demo * //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 Mouse * Monitor with VGA port & VGA cable ---- ===== 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: GPIO/2023.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/GPIO/2023.1-1/Basys-3-GPIO-hw.xpr.zip}} | See //Using the Latest Release//, below | | GPIO/2022.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/GPIO/2022.1-1/Basys-3-GPIO-hw.xpr.zip}} | See //Using the Latest Release//, below | | GPIO/2021.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/GPIO/2021.1-1/Basys-3-GPIO-hw.xpr.zip}} | See //Using the Latest Release//, below | | GPIO/2020.1-1 | {{https://github.com/Digilent/Basys-3/releases/download/GPIO/2020.1-1/Basys-3-GPIO-hw.xpr.zip}} | See //Using the Latest Release//, below | | v2018.2-3 | [[https://github.com/Digilent/Basys-3-GPIO/releases/tag/v2018.2-3|Release ZIP downloads]] | [[https://github.com/Digilent/Basys-3-GPIO/tree/v2018.2-3| v2018.2-3 Github README]] | | v2018.2-2 | [[https://github.com/Digilent/Basys-3-GPIO/releases/tag/v2018.2-2|Release ZIP downloads]] | [[https://github.com/Digilent/Basys-3-GPIO/tree/v2018.2-2| v2018.2-2 Github README]] | | v2018.2-1 | [[https://github.com/Digilent/Basys-3-GPIO/releases/tag/v2018.2-1|Release ZIP downloads]] | [[https://github.com/Digilent/Basys-3-GPIO/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/GPIO/master|GPIO/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 via the microUSB programming cable. Plug one end of the VGA cable into a video monitor and the other into the Basys 3 VGA port. Plug the USB Mouse 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 ===== /* it would likely be helpful to clarify that BTNC is a reset for everything but the VGA */ ==== 1. Switches and LEDs ==== >All sixteen of the user switches are tied to their corresponding LED. Every time a switch is toggled, the LED directly above it will toggle with it. > >{{:basys3:basic_edit.jpg?200|}} {{:basys3:leds_edited.jpg?200|}} ==== 2. Buttons and 7-Segment Delay ==== >The seven segment display is counting all digits from 0 to 9 when no buttons are pressed. If BTNU is pressed, the first digit on the seven segment display is turned off. BTNL turns off the second digit, BTNR turns off the third, and BTND turns off the fourth. BTNC turns off the entire display and resets the counter. > >{{:basys3:btnu_edit.jpg?200|}} {{:basys3:btnr_edit.jpg?200|}} {{:basys3:btnl_edit.jpg?200|}} {{:basys3:btnd.jpg?200|}} ==== 3. VGA Monitor ==== >To use the VGA output demo, plug in your monitor to the Basys3 VGA port. The monitor screen will have series of moving patterns as seen below. > >{{:basys3:basic_edit.jpg?200|}} {{:basys3:20141030_122816.jpg?200|}} ==== 4. USB Mouse ==== >To see the USB mouse portion of the demo, plug a USB mouse into the J2 USB port on the Basys3 with the monitor still connected. On the screen, you should be able to see your mouse pointer and move it around. ==== 5. UART Communication ==== >To see the UART communication channel, open a terminal program on your computer set to 9600 baud, 8 data bits, no parity bit and 1 stop bit. On reset or BTNC, the Basys3 will print BASYS3 GPIO/UART DEMO! to the terminal. On a button press other than BTNC, the terminal will print Button press detected! > >{{:basys3:button_press_terminal.png?600|}} ---- ===== 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.