- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Tags:
- Include
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#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 } }
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page