|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Measuring idle timeHello all.
We are debugging one application in Ethernut3, and we want to measure the time that the micro spends doing some tasks. For that we are setting different pins up and down and measuring times with the oscilloscope. To measure the idle time we are setting up one of the pins during the execution of the idle thread. I am sure that many people have been thinking about/doing this, so I wonder if NutOS provides some kind of debug option or mechanism to do this already. Regards José _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion |
|
|
Re: Measuring idle timeHello all.
> > We are debugging one application in Ethernut3, and we want to measure > the time that the micro spends doing some tasks. For that we are setting > different pins up and down and measuring times with the oscilloscope. > > To measure the idle time we are setting up one of the pins during the > execution of the idle thread. I am sure that many people have been > thinking about/doing this, so I wonder if NutOS provides some kind of > debug option or mechanism to do this already. > I did this once but there was no support in Nut for it. I only had 3 gpio (LEDs in this case) available, but had less than 9 threads including the idle thread, so I added a uint8_t to the thread control block to represent the LED pattern. I also added code in NutThreadCreate to count how many times it had been called and store that in each thread block. Then I added code in task switching to set all of my gpio to 0 while doing thread switching and set them to the pattern of the runningThread when a new thread had been scheduled based on the variable I had added to the thread control block. I then added code in my main thread to print out the thread names and their LED pattern after all my threads were created but before the main thread entered it's normal running state (loop). idle = 001 main = 010 TcpSm = 011 A = 100 B = 101 C = 110 Task switching would be 000 If you have enough gpio available I would suggest strongly using only a single bit per thread rather than a bit pattern since it's easier to scope and measure. Nathan _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion |
| Free embeddable forum powered by Nabble | Forum Help |