Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Nios II Timer

I have the need for a 10 mS periodic timer interrupt for my system. I used the timer in the SOPC builder and selected a time base of 10 mS. To keep the size low, I opted for the simple periodic timer. After loading the new config file and writing a simple program to toggle an LED in the timer IRQ, every thing went well. I used the alarm function. My first attempt was to pass the alarm start function nticks per second so I can see the LED blink. Worked perfect! However, I tried to increase the speed, but there was no change in the IRQ frequency http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif . No matter what I set the ntick parameter to, I always got a 1 second IRQ. Do I need to opt for the fully functional timer in the SOPC? Or is there something that I am doing wrong? Please advise...

Rick

11 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    That could just be because it ensures the interval is at least as long as the one requested.

    It is not uncommon for timers (especially those started in response to a 'tick') to run for one more 'tick' than you might expect - because otherwise the delay will be shorter than the requested interval.

    Having said that, I don't know the specifics of this code.