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.

CCS/CODECOMPOSER: Sapmling rate in graph properties

Part Number: CODECOMPOSER

Tool/software: Code Composer Studio

I am using a pulse generator in Simulink to create a pulse with a pulse width 50% and an amplitude of 100. The pulse is provided to the CMPA input of the ePWM1 block, as depicted in the next picture:

I have built the relevant model with Simulink and I loaded the model in a DSP (Texas Instrument C2000 Experimenter kit, F28335 Delfino Control Card) with Code Composer 6.0.0.

I want to see in a graph in Code Composer the values of the CMPA register, which should normally be the pulse from the aforementioned pulse generator. I set the following parameters in the graph properties: 

However, for any sampling ratte that I choose in the graph properties, around 16 samples per second are always depicted in the graph. This is OK when trying to observe a pulse with a period of 1 or 2 seconds. However, when trying to visualize a pulse with a small period (e.g. 1e-04 seconds) the values are apparently not depicted correctly in the graph. Is there a way to adjust the samples per second that are depicted in the graph? Or alternatively is there another way to correctly depict pulses of small period?

  • Hi,

    If I understood your post correctly, I can't quite understand how 16 samples are shown in the graph. The number of samples displayed at a given time on the graph is given by the option "Display Data Size" - 200 samples in total according to your screenshot.

    The graph uses the "Sample Rate" to adjust the units at the X-axis and correlate them with time. For details about these settings, please check the CCS Help. Go to menu Help --> Help Contents --> search for the term "Graph".

    Hope this helps,
    Rafael
  • Rafael thank you for your answer.

    Concerning the option "Display Data Size", the graph has the capability of displaying 200 samples in total. However, correlating the period I provide in the pulse generator and the graph provided by code composer, it appears that 16 "samples per sec ond" are dispalayed in the graph. For instance when I set a period of 1 second in the pulse generator, I can see that the graph in the code composer uses 16 samples to indicate a pulse in one period. Of course more than one pulses (and more than 16 samples) are displayed in the graph in total due to the value of 200 in the option "Display Data Size".

    The problem is that I cannot find a way to increse the number of samples per second that are displayed in the graph. For instance, when I set a period of 0.001 seconds in the pulse generator, I cannot see a correct pulse in the graph of the code composer. In this case I guess that 2000 or more "samples per second" would be required to display the pulse correctly in the graph. I have searched the CCS help, however I could not find a way to increase the "samples per second" that are displayed in the graph.

    Once again thank you for your answer and I would really appreciate it if you could help me with this issue.
    John
  • John,

    Perhaps a picture of each graph would help, as I am not entirely sure I grasp the scenarios you described.  

    From what I understand, your source waveform has a period of 1s but CCS seems to be sampling it at 16Hz (or 16 samples per second) - is that

    a correct assumption?

    In this case, I find it somewhat strange given the update rate for the CCS views through a JTAG connection can only get down to 100ms (even still, under very limited and ideal circumstances).  

    This would explain why increasing the frequency would also make the waveform disappear - the CCS update rate is not fast enough.

    Ideally you should either add a breakpoint to  "animate" the execution (shown in section 3.4 of this reference) or create buffers on the target device memory that would hold a collection of samples that could store one or more periods of the waveform. To display this, you would increase the Acquisition Buffer Size parameter. 

    Hope this helps,

    Rafael