mod5213 PIT problem

Discussion to talk about hardware related topics only.
Post Reply
e.dinu
Posts: 3
Joined: Thu Dec 06, 2012 9:49 am

mod5213 PIT problem

Post by e.dinu »

Hi,
I am quite new with netburner hardware and I modified the PIT example from this page: http://www.netburner.com/support/resources/mod5213 to give me a 400Hz interrupt. My modifications are in the line: SetUpPITR( 1 /* Use PITR 1 */, 20735 /* Wait 16588 clocks */, 2/*
Divide by 2 from table 17­3 */ ); . I added also a line to keep the pitr_count in a pitrold and show me iprintf the difference between pitr_count and pitrold, which should be 400 for every second. Now my problem is that every about 60 seconds the difference for about 4 values off the difference is 399 instead of 400, like it misses an interrupt. If I change the frequency to the default in the example, it missis once at about 90 seconds and then is not doing it again. Anybody knows why and how should I avoid this? Is it a problem with the PIT timing or the OSTimeDly function?
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: mod5213 PIT problem

Post by pbreed »

Calling OSTimeDly is asyncronous...
the delay is syncronous...

so in fact a call to OSTimedly(n)

Will give you a delay
n-1 < actual _delay < n

So you are see slip in the OSTimeDly and the code around your pause burns up cycles until you slip over the the next count...
Post Reply