Altera_Forum
Honored Contributor
16 years agoUsing nios2 system to let led display,but not success
Today, I had a nios2 system. Time in debugging, are all normal. However, when load in de2 board, not the results of operation. I would like to ask why, and how to resolve them.Thanks!:)
Next is the test programme: # include "system.h"# include "altera_avalon_pio_regs.h"# include "alt_types.h" int main (void) __attribute__ ((weak, alias ("alt_main"))); int alt_main (void) { alt_u8 led = 0x2; alt_u8 dir = 0; volatile int i; while (1) { if (led & 0x81) { dir = (dir ^ 0x1); } if (dir) { led = led >> 1; } else { led = led << 1; } IOWR_ALTERA_AVALON_PIO_DATA(LEDG_BASE, led); i = 0; while (i<200000) i++; } return 0; }