Here's a vid of the FPGA controlling the brightness of the LEDs with 2 buttons.
This small write-up will show you how to control the output pin in VHDL as well as wire it to the board.
The following circuit set up is true for microcontroller boards as well, the only difference is the way you drive them and interact with them in code.
The thing that I was confused was how to connect the digital output to an external LED. I figured out how to wire the circuit to the output. Here is the diagram:


Here is a picture of my setup:
I use the PMOD connectors on the side of the Nexys2 Board. They're pretty much just pins with a a standard header to fit a wide variety of custom boards like ADC, or DAC, Ethernet... bla bla.
The PMOD output pads are labeled by JA1, JB1, JC1, JD1. I chose JA and then connected it this way:
PMOD Header - When looking straight on
5 4 3 2 1 0 - Top Row
5 4 3 2 1 0 - Bottom Row
Column 4 is GND and Column 5 is Vdd. For this circuit, I run a wire from GND to the LED GND and then a wire from Top Row - 3 to the positive side of the circuit as shown on the circuit diagram.
In this configuration, JA<3> is the output pin. I use JA<3> for the output LED, SW<0> as a switch for the LED.
For this, I wrote it in VHDL. The entity is as follows:
In the architecture, I tie the switches together and thats it. Just flick the switch and turn on the lights.
EDIT - Change sw(2) to sw(0)
Lastly, just make sure you comment/uncomment the stuff in the constraints file. Here we uncomment the lines for SW<0> and for JA<3>.
No comments:
Post a Comment