Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

blink led on device- not running user program on board and problem in pin assignment

Hi,

I am new to fpga programming. I am using ep2s60f672c3n stratix fpga device.I need to blink the led of development kit.

module led(led,clk);

input clk;

output [7:0]led;

reg[7:0]le;

always@(posedge clk)

begin

led=8'b0;

end

endmodule

I wrote this program. during pin assignment 'clk' input not able to assign.still compilation success. I am able to download sof fie to device. but led not blinking. that is user program not working. only working factory program. why?

please reply

Than you

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Issue is in your code! With that code leds will not blink. Go through Altera's example design or any standard book to realise proper logic.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I tried not only this ,tried many programs. still not working. in the board there is fpga configuration 3 led's. they clearly shows that during downloading .sof file "loading" led blinks. then it "user mode" led blinks. then halts at factory program, "factory confi" led blinks. and output 8 leds blinks blinks according to factory program.

    please help

    thankyou
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    As far as I can see, this line

    led=8'b0;
    will not cause your leds to blink, it just sets the signal to a constant value. To make them blink you will have to change their value regularly to 1 and back to 0. If the clock clk is too fast for the human eye (most probably) then you will need to implement a counter to only change the signal every n clock cycle.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    sorry , I mean to say, I programmed to light up the led always. since it is in active low I assigned led to zero.

    still wrong?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I solved pin assignment problem . Now having only problem that user program is not running on device.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It could be a problem on your board. Do you have an example .sof file given with the kit that you can try? Does it work?

    One possible cause is that the design you are putting in the FPGA causes a short circuit. This makes the power supply drop and the FPGA will reset.