How to connect a LED with a clock?

Hello All, I am a newbie to FPGA and got recently a new Spartan3E1600 Microblaze development kit. I want very much to start doing something working and have decided that the best place to start is perhaps just to light on a LED on this board. So I have programmed a clock in VHDL which generates '1' and '0' every second (frequency = 1Hz) and download this to FPGA. However i do not know how to connecet my clock to a LED. Could you please, give me idea how to get my clock connected with a LED so that LED would flash with frequency of the clock?

Reply to
Vagant
Loading thread data ...

Connect the signal to the anode of the LED via a 470 ohm resistor.

Connect the other end of the LED to ground (0V).

If you're not sure which end of the LED is the anode, try it both ways. If it's the wrong way, the LED won't light, but you won't cause any damage.

The resistor is needed to control the LED current.

Mike

Reply to
MikeShepherd564

Thank you, Mike but it's not what I meant. I meant LED on board, not just a separate LED which I could connect by wires through a resistor to one of FPGA pins. I think that LED on board can be connected to FPGA without additional circuitry. Such connection can be programmed innit?

Reply to
Vagant

Vagant wrote: [...]

You need to look in the documentation of your board what FPGA pin the LED is connected to. In addition to that you also need to specify where the clock signal comes from in order for your counter to work.

Then you need to make a connection between the output port in your top entity, the one that has the counter output, and that FPGA pin. The way to do that is to enter it in a so called .ucf file.

If you have already run the implementation with ISE/Webpack and did not create a .ucf file youself, I believe it creates one for you. Check the folder your ISE/Webpack files are in, whether there is a file of type .ucf

I give you an example from a Digilent board I have. It is in Verilog, but you should get the idea.

My top module I/O ports are like this:

module dl2 (clk, led, btn)

The ucf file looks like this:

# clock input of the Digilab2 board NET clk LOC = P80 ;

# LED output and pushbutton input NET led LOC = P71 ; NET btn LOC = P77 ;

In addition to the LED you also need to specify the input pin where your clock signal comes from.

Hope this helps.

Cheers,

Guenter

Reply to
Guenter Dannoritzer

Thank you, Guenter. I hope that I have got the main idea but I am a bit slow in getting a whole picture clear. So, as I have understood, one of my FPGA pins, that which was allocated as an output of my 1Hz signal during implementation, has to be connected to a pin of the LED by editing .ucf file. How to do this? And what LOC=P71 means in

NET led LOC=P71

Reply to
Vagant

"P71" is the pin number of the fpga chip. You have to look into your board schematics and see to which pin of the fpga the led is physically connected. Then you enter a command to your ucf file which maps the name of signal/wire of your vhdl/verilog design ("clk","led","btn" etc) to the specified physical pin on the fpga chip (look into the datasheet of the fpga chip for the pin names).

-- Jara

Reply to
jara

Thank you very much. I have found datasheet of my FPGA (XC3S1600E) but cannot find schematics of the board which I have. This is Spartan-3E

1600E MicroBlaze. If anyone knows where to get schematics of this board, please let me know. Thank you. :)
Reply to
Vagant

Thank you very much. I just wonder whether each LED of the board is physically connected to some pin of FPGA or not?

Reply to
Vagant

The Xilinx web site sounds like a good place to start looking.

Reply to
MikeShepherd564

FInd the circuit diagram ("schematic"). Then look at it. If it doesn't make sense, you first need to learn some basic electronics, because a lot of the literature you'll meet as you proceed will assume that you have that knowledge.

Mike

Reply to
MikeShepherd564

Thank you, I have found the schematics at Xilinx Web Site. I am really surprised that I had not noticed this file before. Many thanks!

Reply to
Vagant

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.