Wednesday, 15 April 2015

c++ - Time Short Functions with cpu time using RTEMS operating system -


I'm looking for some code profiles in a real-time operating system, RTEMS mandatory form From, to read the time, there is a bunch of gems of work, in which the most useful is rtems_clock_get_ticks_since_boot .

The problem here is that for whatever reason the clock timer reported, our state machine loop rate is synchronized with 5kHz , while the processor is almost 200MHz Running on (embedded system). I know this because I recorded the time of the clock, waited for 1 second and only 5000 went off.

So the question is:

How do I get real CPU tunes from RTEMS?

PS clock () with GNU C (the same problem)

is a guide I see, but me < Code> impossible impedance in asm which indicates that I have to use some different codeer keywords. Maybe someone can tell me something like this?


Reference

I want to code some code, so essentially:

  start = cpu_clock_ticks ( ) // some code time = cpu_clock_ticks () - get started;  

The code runs in less than 0.125 ms, so the 8khz counter clock () and other functions get the function, do not cut it.

Exact performance measurement can be done using an oscilloscope, provided that a GPIO, test point or Pins can write software (and can attach the oscilloscope probe)

Here the method is to send a pulse on the pin. Osgoco can be set up to trigger the pulse. Some smart ospps can perform statistics on pulse width, such as time and maximum time

On our embedded system, the H / W team was enough to get 8 test points for us to use. We start the pin with zero, at the beginning of the code of the profile, we write pins 1. At the end of the profile code, we write 0 to pin. It produces a pulse or square wave.

Oscosco is set up to trigger on the rising edge. The probe is connected to the pin and the program is running. Adjust the oscope so that the entire pulse is visible on the screen. Run the program again. When the oscope is triggered, measure the pulse width, it will be the real time of execution.


No comments:

Post a Comment