i am using MSP430f5438a and i want to know, how can i measure the execution time of some instructions.
i hope, someone can give me any hint to do this.
You need to know what you are doing before you can get any meaningful result.
You could put together a sequence of instructions to generate a waveform with two "edges" on an oscilloscope. You then insert the instruction in question in that sequence. The increment of time between those two edges "before" and "after" you inserted the instruction is the execution time of that instruction.
You could also use one of the Timer/Counter on the chip instead of an oscilloscope in a similar way. In this case you are measuring the number of clock cycles to execute that instruction.
In both cases, you need to worry about pre-fetch (pipeline) and side effects of the instruction.
I know two methods:
1.) calculate execution time by using CPU clock + instruction cycles + assembler instructions
This is a very time intensive method with a lot of computing and paperwork.
2.) same as old yellow cow recommended
If you have an oscilloscope you can do something like:
instructions of interest
Probably you can also check number of cycles in debug mode.
Thank you for your replies. i will try one of these methodes.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.