Mesauer CPU load?

14 Feb 2012

Hey! I am using a couple of interrupt driven interfaces (PPM-Input, Serial, Timer, ...) for important things. In a main loop I am computing less important things.

Is it possible to mesaure / average the CPU load or an equivalent? I need to know how much "time" the CPU spends for important background processes.

Is there a way?

15 Feb 2012

I think with background processes you mean interrupts? You can measure the time of each isr and sum them up

15 Feb 2012

Quick and dirty: On entering ISR set an O/P hi, then low on exit,

And something similar in your boring code, and yet again for do nothing code. It should also be possible to use a timer, and time each ISR, Set a flag, then in not important bit, Print answers, But be aware, printf at 9600 baud, takes about ONE MILLISECOND PER CHARACTER Which will cause no end of problems in time sensitive stuff.

Going back to first option, you could use an oscilloscope to view The results, or better still a logic analyzer.

Hope this helps Ceri.