I have the following code in my program and I’m using TICK_TIMER. I expected the code inside the if to execute every 34 ticks, which should be 33.2mSec. Instead it’s 66.4mSec. I have run lopower.c and it reports that the starting frequency for my clock is 58.9MHz. Just what I expected. So what’s the deal? Code snippet follows:
main(void)
{
long t1=0, t2;
...
...
...
for(;;) // endless loop
{
t1 = TICK_TIMER;
if (t1 - t0 >= 34)
{
digOut(0,1);
t0 = t1 + 34;
digOut(0,0);
}
}
}
The digOut’s are so I can put my scope on the output and measure the time.
Tom