Forum Discussion
Altera_Forum
Honored Contributor
13 years agoNios II timer and erroneous usleep() results
I am using a Nios II processor running at 50MHz with a timestamp timer and a system timer. I am noticing that the usleep() function is not returning expected time delays. For the code: frame_...
Altera_Forum
Honored Contributor
13 years agousleep() resolution is almost certainly limited by some time interrupt - it will only return after the relevent interrupt.
In order to guarantee the minumim sleep time it is also likely that one clock period is always added. If you preceed the code above with another usleep() call, and then vary the interval you'll see the quantisation (etc).