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.

TMS320F28379D: Problems with Single Graph update ( LAUNCHXL-F28379D)

Part Number: TMS320F28379D

Tool/software:

I'm having issues when visualizing data in the Single time Graph. I started with the example adc_soc_epwm_cpu01, to view a sinusoidal signal. If the buffer size is not an integer multiple of the sampling frequency divided by the signal frequency then the signal on the graph gets distorted, this has been reported previously here https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/888657/ccs-tms320f28379d-adc-conversion-not-working In the thread someone obtained the correct behavior but using a control card. Additionally, I inspected the memory browser and the data matches the distorted waveform. Is it possible that there are some limitations for real-time debugging in the Launchpad compared to the control card? Or is the issue somewhere else? Thanks for the help. 

  • Hi Luis,

    It is the same IC being used on both LaunchPad and controlCARD, so I don't believe this is a hardware issue. The data is coming through the JTAG so ensure you are using 4-pin JTAG with full bandwidth enabled. Can you provide pictures of what you are seeing in terms of distortion? The thread you provided shows like there is a buffer used to collect the data. Judging from the graph, once that data has been collected, while the data is transmitting to the PC, no other data is collected. That is why potential skips in the graph are seen

    Regards,

    Peter

  • Hi Peter,

    Thanks for your reply. I am connecting the LaunchPad with the onboard USB and I'm not sure if this allows for full bandwidth or not. Just to be precise, my input signal is a sinusoidal with a frequency of 2 kHz and I'm also using a buffer to collect the data. I modified the code to allow for continuous acquistion, in the original code the process is stopped after filling the buffer one time, and it can be restarted by clicking the Resume button. Here are some pictures of "normal" waveform and distorted ones. For all views of the graph, I'm choosing the Acquisition buffer size and the Display Data Size equal to the RESULTS_BUFFER_SIZE, which is the size of the buffer, and with continuous refresh.

    BUFFER_SIZE  = 100

    BUFFER_SIZE = 110

    BUFFER_SIZE = 256

    I experimented a bit more and noticed that the problem only occurs when the results are continuously stored in the buffer. If inside the interrupt I only allow the buffer to be filled one time, the waveform is not distorted regardless of the buffer size, I am adding screenshots of this tests as well.  I can restart the buffer filling by manually setting the index to 0, or any other value that is in the range of the buffer size, in the expressions window. When the graph is updated I get the expected view, for example, with a discontinuity at the index that I set in the expressions window.

    BUFFER_SIZE = 110, index = 0

    BUFFER_SIZE = 256 index = 50

    I hope this gives more insights into where the problem is.

    Kind regards,

    Luis

  • Hi Luis,

    Thanks for providing the screen shots from your graph, it helps to better visualize the issue you're seeing. In what part of the program are you collecting the data? Is it during the ISR or have you included this in a background loop? Can you provide the sample code you're using? Ideally you should be able to continually sample the signal and push data to the graph. 

    Regards,

    Peter

  • Hi Peter,

    It is during the ISR. Sure here is the code, the only variable that I am changing before debugging is RESULTS_BUFFER_SIZE

    interrupt void adca1_isr(void)

    {

        AdcaResults[resultsIndex] = AdcaResultRegs.ADCRESULT0;

        if(RESULTS_BUFFER_SIZE == resultsIndex)

        {

            resultsIndex = 0;

            bufferFull = 1;

        }

        resultsIndex++;

        AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //clear INT1 flag

        //

        // Check if overflow has occurred

        //

        if(1 == AdcaRegs.ADCINTOVF.bit.ADCINT1)

        {

            AdcaRegs.ADCINTOVFCLR.bit.ADCINT1 = 1; //clear INT1 overflow flag

            AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //clear INT1 flag

        }

        PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

    }