Need help with the FPGA board

Ok, so I have the SF fpga board, managed to compile to led blink sample, with the provided placements (for example led<0> to “P2”), configure the board via the JTAG.

After this the done let gets on.

Now, if I hook a led with a resistor to the pin marked “2” on the silk screen and to the ground is it supposed to blink? For me this is not working.

Which LED blink sample are you using?

Leon

The one from the SF site:

http://www.sparkfun.com/datasheets/DevT … er_dev.zip

The archive contains the SPI flash loader and the led blink sample.

I use the WebPACK SFD 92i for windows.

I made a new project targeted at the xc3s500e, with the PQ208 Package, speed grade -4, and added the top.v and top.ucf from the above sample.

Is the DONE light turning on indicating successful programming? Also, the 0 bit will be flashing much too fast for the eye to see if I recall correctly.

Cheers,

–David Carne

You should be able to see the signal with a scope.

Leon

Yes, after programming the done led lits up.

I don’t have a scope :cry:

but I tried to just drive the leds to 1 on every clock, so it will stay on, this didn’t worked.

However if I use a continuous assignment independent of the clk, with leds defined as a wire instead of reg:

assign leds = 1;

I will get the test led to lit up.

I’ve got some VHDL code that I use to test my Digilent board which flashes an LED slowly. I’ll see if I can find it.

Leon

Here’s a simple binary blinker that I used to test my digilent board when I first got it. LED# are various LED’s, and ‘in1’ is a switch. You can of course modify the program to include more or less LED’s and/or inputs.

Essentially the code is just a 24-bit binary counter that increments each clock cycle. We’re only displaying the upper few bits of the 24-bit number, which even at a 50mhz clock won’t run blazingly fast – so you get a blinking binary-counting pattern across several LED’s. If you took out all but one LED, it would appear to just be blinking that one (even though the underlying code was actually counting).

Hope that helps, and good luck! FPGA’s can be very fun.


`timescale 1ns / 1ps

module blink1(clk, in1, LED1, LED2, LED3, LED4, LED5, LED6);

input clk;

input in1;

output LED1;

output LED2;

output LED3;

output LED4;

output LED5;

output LED6;

reg [23:0] cnt;

always @(posedge clk) cnt <= cnt + 1;

assign LED1 = cnt[23];

assign LED2 = cnt[22];

assign LED3 = cnt[21];

assign LED4 = cnt[20];

assign LED5 = cnt[19];

assign LED6 = in1;

endmodule

If I toggle the LEDs on a asynchronous event (like a button) on another pin it works.

But, if I try anything on the clock signal it doesn’t work.

do you have the clk input assigned to the pin sourced from the 50mhz clock?

Cheers,

–David Carne

With

NET “btl” LOC = “P29” | IOSTANDARD = LVCMOS33 ;

NET “clk” LOC = “P181” | IOSTANDARD = LVCMOS33 ;

This will not work:

always @(posedge clk)

led <= 1;

But, this does work, turns the led solid on as soon as a button is pressed on pin 29:

always @(posedge btl)

led <= 1;

Huh, that looks fine. Are there any warnings in synthesis? Does the premade example binary in the test package work? Also, if you stick a multimeter on the clock output, what does it read? [should read ~1.6V, due to the averaging]

Cheers,

–David Carne

I don’t know how to program the premade file, it looks like it was made for the flash rom.

I don’t have any warnings on synthesis and if I use:

NET “clk” LOC = “P28” | IOSTANDARD = LVCMOS33 ;

So the “clk” is now the button it will also toggle the led on.

On the clock pin the voltage reads 0.016, I take it this is not a good sign :frowning:

On a visual inspection the oscillator pins look like they have good solders to the PCB and the voltage reads 3.3v on the 2 voltage and enable pins, but close to 0 on the pin that runs to the clock pin input, even if I measure it right next to the oscillator.

Is there a chance there is a problem with the oscillator iself or the pad solder for the oscillator ?

Could be either, but oscillator test is part of the test procedure for that board. If you set the board to boot out of the PROM, whats the voltage on pins 2,3,4,5 ?

They should each be alternating at half the speed of the next lower one.

If that doesn’t work, you might want to consider talking to SFE about a return for testing / replacement.

Cheers,

–David Carne

Some updates on my problem, I ordered a few spare oscillators from digikey, they got here today and I changed the original oscillator with a new one, same 50Mhz…etc…

Yes, the old oscillator was the problem, now I can blink LEDs all I want.

:wink: