This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Estimating Cycle Count using CCE 3



Hello All,

 

I am using Code Composer Essentials v3 to developed a small program using a mixture of C and assembly. I would like to be able to estimate the cycle count from the final compiled code. I have not found an easy way to do this. Does anyone have any suggestions. I've been looking into using IAR or mspgcc without much success. I can not use Code Composer Studio as it does not have support for the MSP430 that I am using. Thank you,

 

Brian

  • Hi

    You can use an oscilloscope and toggle an output. This way you will measure the time required to execute the code between output toggle.

    Best regards
    AES

  • Hi Brian,

    I am not sure if your code is very large. CCE does have a clock feature that can be used to get the correct cycle count. I have pasted the setup instructions. Single stepping can be done for small code, however, this might be get a little taxing if the code size /functionality is large. For this, you can set a breakpoint and let the CPU run and see the clock counter at the end. This automatically forces single stepping on the device and would also take a long time for final values to appear.

     To view the clock: Target > Clock > View

    To enable the clock: Target > Clock > Enable
    To change the settings: Target > Clock > Setup
    The clock is seen at the bottom right corner of the CCE window

     For IAR, this should be fairly simple, put the IDE in simulator mode and then select CPU registers and watch CCTIMER1 or CCTIMER2 change as you single step. Breakpoint followed by a GO would not be slow in this case. If an actual target is used, place the breakpoint inside the Disassembly window and single step or hit GO. However, presence of the target forces single stepping and would be time consuming.

    Kripa

  • Kripa is right. Both IAR and CCE have built in cycle counter features in the IDE but if you want accuracy and speed you'll probably want to bust out the o-scope and output your system clock from a pin.  forced single stepping through code can take a very long time and the cycle counter is only moderatly accurate. 

**Attention** This is a public forum