Forum Discussion
Hi, I will take a short look into that code. In the Device settings, are you sure you got the device right? On my neek there is a EP3C25F324C6 and you took the C8. (if you change the device the assignments are lost, so copy them from assignment editor before you do so. After changing you can paste them back in again) Then into SOPC: First I would select 4Bit for the PIO, as you don't have 8 LEDs on the neek. In the code defined pins, but not connected shows up white in pinplanner. Most times something is wrong with names or datawith when you have assigned the FPGA-Pins and there are afterwards white ones over. Rest of the NIOS looks fine, but you will need more ram to run your programs, so take 40Kb of onchip_memory. Perhaps you will have to optimze the addresses then. Try "System / Auto-Assign" for that, now I generated that system and back to Quartus.
For the system I can't help you very much, as my verilog is really bad. I would have written// Define the module inputs and outputs
module MyFirstFPGA(CLOCK, RESET, LEDS);
input CLOCK;
input RESET;
output LEDS;
// Instantiate the NIOSII processor
niostest niostest_inst
(
.clk (CLOCK),
.out_port_from_the_LEDs (LEDS),
.reset_n (RESET)
);
endmodule The Instiantiation of niostest is described in niostest_inst.v I would just take that description for the initialisation. (Perhaps that code is different in your case because it was here generated with Quartus 9.1.) So then I reanamed RESET and now synthesis is running. I now load that into the neek, opencore stayes connected. And up to NIOS Eclipse >> new Application and BSP from Template >> HelloWorld. Pasted: #include <stdio.h># include "system.h"# include "altera_avalon_pio_regs.h"
int main()
{
int count = 0;
int delay;
while(1)
{
IOWR_ALTERA_AVALON_PIO_DATA(LEDS_BASE, count & 0x0F);
delay = 0;
while(delay < 2000000)
{
delay++;
}
count++;
}
return 0;
}
And it works nicely, without problems on the first try. :confused: So no problem.