Forum Discussion
Altera_Forum
Honored Contributor
22 years agoNios 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 tim...
Altera_Forum
Honored Contributor
22 years agoHi rppolicy.
Here are my thoughts... When you call the alarm_start function, the first call to alarm_callback will go occur in nticks. After the alarm_callback function gets called, the return value of the alarm_callback funtion becomes nticks. If you started with a sample timer, the alarm_callback function will look something like this:alt_u32 my_alarm_callback (void* context)
{
/*
* This return value is used to determine when the call back function will
* be called again... In this case, once every second
*/
return alt_ticks_per_second();
} where the return value (100) is the number of ticks until 1 second expires, which then calls your alarm_callback funtion again (once every second). I believe that if you return 1, you will get an interrupt in "one tick" which should be your 10 ms. Hopefully this helps. tjd