Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

ELF downloaded but switchers don't respond !!!

Altera_Forum
Honored Contributor II
1,027 Views

hello 

I am working on niosII 13.0 web edition trying to command 2 LEDs using 2 Switchers on Cyclone III board 

the niosII console shows that the elf is downloaded BUT when i click on Sw nothing happens !! 

what could be the problem ?! 

 

Downloading 00004000 ( 0%)Downloading 00004F0C (61%)Downloaded 4KB in 0.0s Verifying 00004000 ( 0%)Verifying 00004F0C (61%)Verified OK Starting processor at address 0x00004020
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
239 Views

#include "io.h" 

# include "system.h" 

 

/** 

* Gets led_pattern as parameter in order to write to the register. 

*/ 

void set_led(unsigned char led_pattern) { 

IOWR(LED_BASE, 0, led_pattern); // writes register 

 

/** 

* Main, what else? 

* Gets LEDs pattern from switchers. 

* Sets LEDs register according to the pattern. 

**/ 

void main() { 

unsigned char led_pattern = 0x00; 

 

while (1) { // infinite loop 

led_pattern = IORD(SWITCHER_BASE, 0); // gets LEDs 

set_led(led_pattern); // sets LEDs 

}
0 Kudos
Reply