Forum Discussion
Altera_Forum
Honored Contributor
14 years agoTimers
Hello, Im new to Nios. In my system there are 2 timers:timer_0 and timer_1. Defined as follow in system.h: /* * timer_0 configuration * */ #define TIMER_0_NAME "/dev/tim...
Altera_Forum
Honored Contributor
13 years agotimer_0 must be defined as the system timer by default. You can change it to timer_1 by updating it in the bsp settings in NIOS SBT tool.
The prototype for alarm start is: int alt_alarm_start ( alt_alarm* alarm, alt_u32 nticks, alt_u32 (*callback) (void* context), void* context ) Think nticks is what you are looking for. You can use it to trigger a callback function after 100us systicks. One the callback is triggered, you can restart the same alarm within the callback itself.