Learn how to make an FPGA circuit in DesignLab with this more advanced example. Shows a couple more tricks then the previous example.
In this tutorial we’re going to show how to make a new FPGA sketch of a circuit that consists of a debouncer, a flip-flop, and an inverter. This circuit takes input from a button,then debounces that input. The output of the debouncer will drive a flip-flop that is connected to an LED. Every time we press a button, it will toggle the LED.
Create A New Project
Create a new FPGA circuit by clicking on the “New” icon, or by choosing “New FPGA Circuit Project” from the File menu.
This will open the template of a blank circuit. This template is not editable, so you have to make a copy in order to be able to edit.
Save the template as a new sketch, name it for example “Quickstart_Demo_FPGA”.
You should see that the line “#Define circuit blank” is commented, because when you saved a copy, it brought a copy of the circuit into our sketch directory. Now you’re using the circuit that is associated in the same directory as your sketch.
Edit the Circuit
Click “Edit Circuit” icon to open the ISE schematic editor.
Find the top level file (has an inverted tree icon), and double click on it.
This will show the blank circuit.
Create the Main Circuit
To select a debouncer, go to the “Symbols” tab, Select the “building blocks” library from the Categories list box, then select “debounce” from the Symbols list box.
To add a flip-flop, Select “Flip_Flop” from the Categories list box, then select “fd” from the Symbols list box.
Connect the clock input of the flip-flop to the output of the debouncer by dragging the clock pin of the flip-flop to touch the output pin of the debouncer.
To add an inverter that connects the output of the flip-flop to its input, select “All_Symbols” from the Categories list box, then select “inv” from the Symbols list box.
You will need to rotate the inverter by choosing “Rotate 180” from the Orientation combo box.
To connect the inverter to the flip-flop. click on the “Wire” icon then draw a wire from the output of the flip-flop to the input of the inverter. Draw another wire from the output of the inverter to the input of the flip-flop.
Connect the I/O Markers
Add the I/O markers to the circuit pins, by clicking on the “I/O markers” icon the clicking on each of the circuit pins.
You will probably need to delete the wire connecting the output of the flip-flop to the input of the inverter, add the I/O marker , then redraw the wire.
To define the pins, go to “Design” tab, and click on “Utility”
This will show all the pins that are available for the Papilio Pro. The “Misc Pins” box shows the pins that apply to all boards.
To choose the clock pin, click on “Add Net Name” icon, click on the “Pick up Name” option button, then click on the CLK pin. This will pick the name.
In the Papilio board, Pin AL0 connects to a push button, and pin AL1 connects to an LED.
Repeat the same naming process by selecting the “WING_AL0” pin to name the button input of the debouncer, and the “WING_AL1” pin to name the output of the flip-flop.
You can simply rename the pin by right clicking the pin, select “Rename Port”, and type the name of the pin. Here we use “WING_AL1” for the output of the flip-flop.
Connect the “Reset” to ground.
First, select the ground symbol. Select “All_Symbols” from the Categories list box, then select “gnd” from the Symbols list box
Then draw a wire to connect the ground symbol to the “Reset” input of the debouncer.
Now the final circuit should look like this:
Generate the Programming File
To synthesize the circuit to be ready to load to the Papilio board: go to the Design tab, then click “Generate Programming File”
Load the Circuit to the Papilio Board
Go back to the sketch window. Click on the “Load” icon.
Now this circuit is now loaded to the Papilio Pro. If you connect a button to the AL0 and an LED to AL1 WING slots, when you press the button, the LED will flip-flop.
Full Video Walkthrough