This tutorial is also available in a more verbose form, with screenshots and additional information! Note: This tutorial was made for the Mojo v3 board using Xilinx ISE 14.6 on Windows 7. Important: Before following this tutorial, make sure you have your development environment set up properly. The guys at Embedded Micro do a much better job describing this process than I could. See their tutorials at: IntroductionThis tutorial teaches you to make a barebones Xilinx ISE project compatible with the Mojo FPGA development board.The final code will toggle an LED with the push of the Reset button on the board. Creating the Project
The next window allows you to enter information about the hardware you are targeting.
Adding a Source File
Every module has a number of ports that provide input and output, similar to parameters and return values of a function in a language like C or Python. We define these now:
Modifying the CodeThe reset button on the Mojo board generates a HIGH voltage when the button is unpressed. So, to get the LED to turn on when the button is pressed, we will need to invert the signal from the button. To do this, we use the "~" (NOT) symbol. In Verilog, the "assign" command is used to connect two nets together. So, in order to tie the LED and reset button together, we write the following line:
This line goes inside the module (between the declaration and the EndModule line). Assigning the PinsISE needs to know what pins on the FPGA each port in the module is connected to. To do this, we use an additonal file in the project:
Inside the file, we write lines in a special syntax to attach ports to physical pins. For this project, the content of the .UCF file should be: NET "RESET_N" LOC = P38; NET "LED" LOC = P123; Configuring ISEAt this point, our code is all set to go. However, we still need to configure a setting inside ISE to make sure we generate the correct output.
Programming the MojoTo generate the binary file, first ensure the module file is selected in the file hierarchy. Then, double click on "Generate Programming File" in the bottom left. Then, open the mojo_loader application, select the binary file from the project, and upload it to the Mojo. Now, when you press the button on your Mojo, the LED closest to the button should light! Thank
you for following this tutorial. If you have any questions about it, or
something didn't work right, don't hesitate to reach out to me from the
Contact page! Also, check out the verbose version in case this wasn't enough information for you. |
Tutorials > Mojo FPGA Tutorials >