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.

How to use count event on Stellaris LM3S8962 running out of Flash

Is there any detailed description of how count events work? I get counts but I am not sure what they mean.

Thanks, Don

  • Don,

    Check the section Clocking features of the page below:

    http://processors.wiki.ti.com/index.php/Stellaris_support_in_CCS

    It shows how to count several types of events using the hardware-embedded SCTM registers of the M3 core.

    For example, you can enable the Count Event --> Clock Cycles to count the time between specific portions of your code. 

    Enable the count event as shown in the page, right-click on its entry in the Breakpoints view, select Properties and check the box marked Reset Count on Run. Set a breakpoint in a line of your code and put the device to run. The resulting count is the number of cycles taken by the device to reach the breakpoint. To know how much time in seconds has passed, simply multiply the number and 1/CLK - CLK is the clock speed of the device (typically 50MHz or 50*106Hz).

    Hope this helps,

    Rafael

  • Rafael

    OK, thank you. I did see that but what was a bit confusing to me was that you setup the count event like you do a breakpoint so I was thinking that you would have to set up 2 of them one where you want to start and one where you want to end. But if I now understand correctly there is really only a single cycle counter and you use breakpoints to allow you to start/stop the count.

    Thanks again, Don

  • Don,

    Yes, you are correct; a single counter performs profiling. I added the procedure to profile functions between two breakpoints to the page I sent before.

    Regards,

    Rafael