Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Turn on 4 leds nios II

Altera_Forum
Honored Contributor II
1,425 Views

hello, 

I have a FPGA Cyclone III ep3c25. I use NIOS II, I turn on the first LED. Now how to turn the 4 LEDs.  

i use this code to blink first led. 

#include <stdio.h># include "system.h"# include "altera_avalon_pio_regs.h" int main() { printf("Hello from Nios II!\n"); int count=0; int delay; while(1) { IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE,count & 0x01); delay=0; while(delay < 2000000) { delay++; } count++; } return 0; }
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
303 Views

Replace count & 0x01 with count & 0x0F and all your 4 LEDs will toggle according to the count binary code

Altera_Forum
Honored Contributor II
303 Views

only first led blinking :( 

i use sopc of kits/standards
Altera_Forum
Honored Contributor II
303 Views

Are the LEDs correctly connected to upper bits of PIO port? 

Are the PIO/LED signals correctly assigned to the FPGA pins driving the LEDs? 

If the PIO has bidir capability, are the upper PIO pins configured as outputs?
Reply