Forum Discussion
Altera_Forum
Honored Contributor
14 years agoBlinking LED - stays on
I was trying to use NIOS to get an LED to blink over a set period. However, everytime the code is loaded the LED stays on. After a couple of hours of troubleshooting I added a print statement f...
Altera_Forum
Honored Contributor
14 years agoMoving the definition of 'delay' outside the function, and making it
volatile int delay;will force the compiler to generate the code loop. I'd also add two more zeros to the count. At a guess, the delay loop is about 20 clocks (with volatile data), at 100MHz you'd need about 2500000 iterations to get 1Hz flash.