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.

cpu usage % c2000 28069

Other Parts Discussed in Thread: TMS320F28069

Hello,

my system

I have a custom pcb with the mirco tms320f28069 used to control  a BLDC motor.

tools    Code Composer Studio 6.1.1

The question.
 

I would need to know the use of the CPU with the ccs debugger to check , if I can add other control functions, or i'am arrived at the limit of usage.
I read a lot of  posts but none of them has allowed me to get clear this parameter without errors or problems.

so I am here to ask if anyone knows how to do step by step, by releasing for me (at the (at the beginning with texas instrument products), but also for the other forum users a detailed guide that is really help and lear explained.


thank you

  • Hi Andrea,

    I would recommend looking at the following wiki article, if you have not already:
    http://processors.wiki.ti.com/index.php/Profiling_on_C28x_Targets

    The profile clock will allow you to measure the amount of clock cycles - for an ISR.  Knowing the ISR rate should then give you a very good idea about the % of CPU bandwidth taken up by the ISR.  As mentioned in the wiki article, toggling GPIOs or utilizing CPU timers can also be useful.

    (please note that CCS6 is not very different from CCS5. Therefore the comments for CCS5 in this article will largely correspond to CCS6)

    Hopefully this helps!


    Thank you,
    Brett

  • Hi Brett,

    yes i have read it, but i i need to go in depth and make everything clear from my point of view, so i need to ask more things now if you are available

    1)  i have to insert 2 breakpoints  one at the beginning of the main isr and one at the end? as show below

    2) i have set the clock countenter (for example 10000), but when i receive the number whatever will be, how i convert it in percuntuale ? what is the calculation that i have to make? (if you can give me a formula that will be great)

    For example what i loking for, i to check with the current code that i wrote what is the aumont of usage, example  i'm use the  25% of the cpu that work at 90 MHz.

    Cheers for you help

  • Hi Andrea,

    1) Yes, correct.  (although the pictures you uploaded are identical :) ).  Enable the Profile Clock.  Put a breakpoint at the start of the ISR.  Run to breakpoint.  Clear the Profile Clock.  Remove breakpoint and put a new breakpoint at the end of the ISR.  Hit run to go to the next breakpoint.  The value in the Profile Clock is the number of CPU cycles that have elapsed between the breakpoints.

    [the game of removing/adding breakpoints is only necessary when the code you're profiling resides in FLASH. This is because there are only a few hardware analysis resources within our device - resources capable of halting the FLASH program.  Breakpoints when running from RAM are less limited]

    2) The number you will receive is the number of cycles that it takes to run your ISR.   You should know the frequency that the CPU is running and the frequency of your ISR.  With these three pieces of information, you should be able to find the CPU utilization caused by your ISR.

    [Please note that if there are if/else/branches in your code each ISR may not be identical - so you may need to measure the ISR many times and look at the worst case (or manipulate the code so that it takes the worst case path)]


    Thank you,
    Brett

  • Hi brett,

    yes i posted the wrong picture, but i see that you understood me.


    so these is the data that i collect

    max clock count 6350

    main_isr  work every 6.6 kHz 151us

    cpu freq 90 Mhz 11.1ns

    the calculation that i need to make is the follow, but corect if this is incorrect


    T_isr = 6350 * 11.1 ns = 71 us

    i believe that te formula is

    (71/151)*100 = 47% ?


    thanks for your real help to find this parameter that for me now is very important to know.

  • Hi Andrea,
    That looks correct.

    -Brett