- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I wants to control leds on DE0_Nano board using Nios II Eclipse, for this anybody can provide code part?Because im very new to this , sory for lack of knowledge. Thanks, Alex.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create a PIO in your SOPC Builder / QSys project, and in the top level file in Quartus, connect this PIO port to the FPGA pins connected to the leds.
Then in your Nios II project you will have some macros to control the PIO port, defined in altera_avalon_pio_regs.h.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reply,
But i got the error like PIO_LED_BASE undeclared(first use in this), altera_avalon_pio_regs.h:No such file or directory make :***[obj/defaults/hello_world.0]Error Any ideas? Alex.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have a PIO in your SOPC/QSys system? Then the altera_avalon_pio_regs.h include file should automatically be included in the BSP.
What name did you give your PIO? The name to use is your PIO name, in capital letters, with a _BASE suffix. For example if you called it my_pio, you must use MY_PIO_BASE.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for prompt response, my PIO name is mismatched,now that problem solved, but when i run the program ,the output is
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] like this coming continously. Actually i wants to control leds on DE0_Nano board. Some times its showed errors also make:***[../Helloworld_bsp/-recurs-make-lib make[1]:*** [public.mk] Error1 Thanks, Alex.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does your software project look like? Can we have a look at your main() function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Iam using Nios II 11.1 version,
My Nios Project is [#include <stdio.h># include"ststem.h># include "altera_avalon_pio_regs.h" int main() { printf("Hello form Nios II); int count=0; int delay; while(1) { IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED_BASE, count & 0x01); delay=0; while(delay< 2000000) { delay++; } count++; } return 0; }] This is the my program, whre is the mistake? Thanks, Alex.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some mistakes in your code, I assume they come from a copy/paste error. The include line should be#include <system.h>
and you didn't close the string in the printf line. You should also end the line with a \n to be sure it is written to the UART.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sory for lack of my knowledge, i will tel what i did
1.Created a empty project in Quartus 11.1, under ubuntu. 2.Generated the system(SOPC builder)like sdram, altpll_sys,cpu,jtag_uart,timer_0, PIO_LED. 3.Created block and symatic diagram(In symatic diagram inputs is clock and reset remaing all those things are outputs) 4Eclipse--->program (previously which i posted in# 7) Now my problem is iam unable to run the Nios II program it showing error is elf file download failed, but .sof file is i downloaded correctly only, where is the mistake? Problem with my .sof file? Kindly any help ? Thanks, Alex.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you start the project from scratch? It can be a bit difficult to get some parameters right, such as the sdram. It is easier to start with a reference project from the kit DVD and add your own components from there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for ur help Sir,
I successfully running the uclinux on DE0_Nano board, after that i wants to add the feature of leds.I mean after running uclinux the leds should glow. For this nios2 Eclipse is enough or i need to get any other software? Kindly any help? Thanks, Alex.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have never used uclinux, but if you start from a working example all you should need is to add the PIO to the project to connect to the LEDS, and the PIO macros to control them from the software side.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page