[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Strange thing...

From: Dave Hansen
Subject: Re: [avr-gcc-list] Strange thing...
Date: Mon, 22 Sep 2003 11:23:54 -0400

From: John Yannakopoulos <address@hidden>

unsigned short value = 62;
unsigned short i;

for (i = 0; i < value; i++) ;

When 'value' equals to 62, I get a time value of 190 cycles. When I
set 'value' to 64, the time measured is 16 cycles! What am I doing wrong?

Hard to say.

What do start_timer and stop_timer do? I mean specifically, beyond the obvious "starting and stopping the timer." What timer? How do you start it? How do you stop it? How are you reading the results?

How are you calculating cycles? Are you getting overflow on an 8-bit timer or variable?

Are you getting interrupts during your timing loop?


Add MSN 8 Internet Software to your existing Internet access and enjoy patented spam protection and more. Sign up now! http://join.msn.com/?page=dept/byoa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]