[Top][All Lists]

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

Re: [avr-gcc-list] execution time on avr butterfly?

From: Anton Erasmus
Subject: Re: [avr-gcc-list] execution time on avr butterfly?
Date: Thu, 09 Feb 2006 19:48:14 +0200

On 8 Feb 2006 at 8:53, David Brown wrote:

> > Hello,
> >
> > I'm writing a C program that will run on AVR
> > butterfly. I'd like to know how I can measure
> > execution time of my program. Could you please help me
> > with this? Thank you very much.
> >
> > Regards,
> >
> > Dave
> >
> Often the best way to measure execution time in embedded systems is to set a
> pin high when you start the relevant code, and low at the end, and connect
> an oscilliscope probe to the pin.  This can be good for checking interrupt
> routine execution times too, especially if you've got a scope with nice
> triggering capabilities (trigger on a pulse longer than a given time, for
> example).

If you have a few spare I/O pins, then making a crude DAC using an R-2R
ladder network works quite well. Write the highest value to the "DAC" at the 
of the first section you want to measure, the next highest at the next point 
Set your scope trigger level to trigger at the higest level and you can see the
time taken by different sections of code on one scope trace.

  Anton Erasmus-- 
A J Erasmus

reply via email to

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