Hello alla,
How to find the execution time of msp430.
by
naz
Hello alla,
How to find the execution time of msp430.
by
naz
What do you mean by “execution time”?
Leon
i’m using two functions for transmitting and receiving,i want to know the total time of the program.
Using a simulator is one way, or you could count the instruction cycles manually. You can also output a signal before and after the relevant piece of code and check the time with a scope. I’ve used all those techniques.
Leon
If the code includes polling IFGs or waiting for ISRs, counting cycles is not easy to do. Use a scope is more practical.
If you use serial communication for transmitting and receiving data, the bit-rate and the amount of data probably dominate the total execution time. But floating-point calculations, printf(), and stuff like that can add a lot of extra time too.
Naz,
set up timer_a to clock from either ACLK or SMCLK, start running and you can initialise a capture channel which can be software triggered. Capture timer_a counts at the start and then end of your comms routine to get the delta_t. you will need to make sure that the resolution of the time base is in the right range.
Another way is to re direct the SMCLK or ACLK to the port pins during the communications stuff and count using a frequency counter to determine OSC ticks so you can relate to time or measure pulse length as per Leons suggestion.
Steve