FPGARelated.com
Forums

How to connect a LED with a clock?

Started by Vagant January 6, 2008
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?
On Sun, 6 Jan 2008 03:15:36 -0800 (PST), Vagant
<vladimir.v.korostelev@rambler.ru> wrote:

>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?
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
On Jan 6, 1:34=A0pm, MikeShepherd...@btinternet.com wrote:
> On Sun, 6 Jan 2008 03:15:36 -0800 (PST), Vagant > > <vladimir.v.koroste...@rambler.ru> wrote: > >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 =3D 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? > > 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. =A0If 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
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?
Vagant wrote:
[...]
> 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?
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 <project_name>.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
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



On Jan 6, 1:52 pm, Vagant <vladimir.v.koroste...@rambler.ru> wrote:
> 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
"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
On Jan 6, 3:25=A0pm, jara <jaroslav.syk...@gmail.com> wrote:
> On Jan 6, 1:52 pm, Vagant <vladimir.v.koroste...@rambler.ru> wrote: > > > 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? =A0And what LOC=3DP71 means in > > > NET led LOC=3DP71 > > "P71" is the pin number of the fpga chip. You have to look into your > board schematics and see to which pin of =A0the 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) =A0to the specified physical pin on the fpga > chip (look into the datasheet of the fpga chip for the pin names). > > -- 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. :)
On Jan 6, 3:25=A0pm, jara <jaroslav.syk...@gmail.com> wrote:
> On Jan 6, 1:52 pm, Vagant <vladimir.v.koroste...@rambler.ru> wrote: > > > 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? =A0And what LOC=3DP71 means in > > > NET led LOC=3DP71 > > "P71" is the pin number of the fpga chip. You have to look into your > board schematics and see to which pin of =A0the 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) =A0to the specified physical pin on the fpga > chip (look into the datasheet of the fpga chip for the pin names). > > -- Jara
Thank you very much. I just wonder whether each LED of the board is physically connected to some pin of FPGA or not?
>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. :)
The Xilinx web site sounds like a good place to start looking.
>Thank you very much. I just wonder whether each LED of the board is >physically connected to some pin of FPGA or not?
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