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: Procedure for Exporting Graph Data (integer or float) to CSV in CCS 20.2

Part Number: TMS320F28379D

Tool/software:

Hello,

I have recently migrated from Code Composer Studio (CCS) version 12.6 to CCS version 20.2. In CCS 12.6, I was able to log the required data into an integer array and subsequently visualize it using the graph tool available in the Expressions window. Furthermore, the graph tool provided an option to directly export the plotted data to a .csv file, which I then utilized for further post-processing and analysis.

However, in CCS 20.2, I have been unable to locate an equivalent feature for exporting the captured data from the graph tool. Could you kindly provide guidance on how to achieve the same functionality in CCS 20.2?

Thank you

Vijay

  • Hi Vijay,

    The graph feature description can be found here: https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_debug-main.html#graph-view

    It seems that it may only support PNG export at this time.

    F28379D supports our Signal Sight tool which you can also integrate into your project for high-speed data export. You can find more information about that here: https://www.ti.com/lit/pdf/spradn1 

    This tool supports CSV export

    Regards,

    Peter

  • Hi Vijay,

    Please download 20.3.0, this contains updated CCS Graph features like below

    • FFT graph supports magnitude and phase
    • Add the ability to export graph data to a file
    • Add the ability to specify data type size

    Regards,

    Peter

  • Hello Peter,

    I downloaded CCS 20.3. I have a simple program in which a unit sine_wave of 50 hz is passed thorough a  low pass filter of 50 hz. I want to plot the data captured. I am using an array to store a data for 1 cycle and plot it. 

    When I graph it. I get the below view

    Even though the Array contains proper values (i can the array has proper values in float). But the graph doesn't reflect that. The code is as below.

    //#############################################################################
    //
    // Toggle GPIO pins 22, 52 and 97 using timers
    // CPU1 controls GPIO 22 and 97
    // CPU2 controls GPIO 52
    // CPU1 uses Timer 0 and Timer 1 for toggling pins
    // CPU2 uses Timer 1 for toggling pin
    //
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "math.h"
    #include "First_order_filter_MACRO.h"
    #include "PI_CONTROLLER_AntiWindup_MACRO.h"
    
    float32_t theta = 0, delta_theta=0.031416;
    float32_t sineval = 0, FO_filter_out = 0.0, FO_filter_prev = 0.0;
    float32_t i_n = 0.0, i_n_1 = 0.0, v_n = 5;
    
    uint16_t data_capture = 0;
    float32_t sine_values[200], filtval[200]; 
    float32_t RLresp[200], v_in[200];
    uint16_t i = 0;
    float32_t tau = 1/(2*M_PI*50);
    float32_t Ts = 100e-6;
    float32_t y_n_1 = 0, y_n = 0;
    float32_t L = 7.5e-3, R = 10;
    
    float32_t FO_filter (float32_t x_n, float32_t y_n_1);
    float32_t RL_filter (float32_t v_n, float32_t i_n_1);
    
    FO_FILTER FO_sine = FO_FILTER_DEFAULTS;
    PI_Controller I_RL = PI_CONTROLLER_DEFAULTS;
    
    uint16_t a=0;
    
    __interrupt void timer0_isr(void) {
        // Execute control algorithms
        // Toggle GPIO 22
        HWREG(GPIODATA_BASE + GPIO_O_GPATOGGLE) |= (uint32_t) 0x400000U;
    
        if(theta<=2*M_PI){
            sineval = 1*sin(theta);
        }
        else {
            theta = 0;
        }
        theta+=delta_theta;
        
        FO_sine.x_n = sineval;
        FO_filter_macro(FO_sine, tau);
        I_RL.error = sineval;
        PI_CONTROLLER_AW(I_RL);
         // FO_filter_out = FO_filter(sineval, FO_filter_prev);
         // FO_filter_prev = FO_filter_out;
        // i_n = RL_filter(v_n, i_n_1);
        // i_n_1 = i_n;
    
        if(data_capture==1)
        {
             sine_values[i] = sineval;
             filtval[i] = FO_sine.y_n;
             //filtval[i] = I_RL.y_sat;
            // RLresp[i] = i_n;
            // v_in[i] = v_n;
             i++;
            // if(i > 50){
            //     v_n = 10;
            // }
            
             if(i > 199){
                 i = 0;
                 data_capture = 0;
            //     v_n = 5;
             } 
        }
    
        //uint16_t dacA_value = (v_in[i]/10.0)*4095;
        // HWREGH(DACA_BASE + DAC_O_VALS) = (uint16_t)((v_n/10.0)*4095);
        // HWREGH(DACB_BASE + DAC_O_VALS) = (uint16_t) (i_n_1*4095);
    
        HWREGH(DACA_BASE + DAC_O_VALS) = (uint16_t)(((1+sineval)/2)*4095);
        HWREGH(DACB_BASE + DAC_O_VALS) = (uint16_t) (((1+FO_filter_out)/2) * 4095);
        
        // Cleanup
        // Clear flag in timer module
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TCR) |= 0x1000U;
        // Clear ACK bit in PIEACK register
        HWREGH(PIECTRL_BASE + PIE_O_ACK) |= (uint16_t) 0x1U;
    }
    
    float32_t FO_filter(float32_t x_n, float32_t y_n_1){
        float32_t y_n = (Ts*x_n + tau*y_n_1)/(Ts + tau);
        return y_n;
    } 
    
    
    float32_t RL_filter(float32_t x_n, float32_t y_n_1){
        float32_t y_n = (Ts*x_n + L*y_n_1)/(L+Ts*R);
        return y_n;
    } 
    
    
    __interrupt void timer1_isr(void) {
    // Execute control algorithms
        // Toggle GPIO 22
        HWREG(GPIODATA_BASE + GPIO_O_GPDTOGGLE) |= (uint32_t) 0x2U;
    
    
        // Cleanup
        // Clear flag in timer module
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TCR) |= 0x1000U;
    }
    
    //
    // Main
    //
    void main(void)
    {
        // Initialize device
        Device_init();
    
        // Disable interrupts and clear them at the CPU
        // Initialize PIE module
        Interrupt_initModule();
    
    
        // Initialize PIE Vector Table
        Interrupt_initVectorTable();
    
    
        // Enable clock to Timer 0 and Timer 1
        EALLOW;
        HWREG(CPUSYS_BASE + SYSCTL_O_PCLKCR0) |= (uint32_t) 0x18U;
        EDIS;
    
    
        // Configure Timer 0 and Timer 1
        // Stop the timers
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0x10U;
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0x10U;
    
        // Load the period value
        // Timer 0 = 1 second interval, Timer 1 = 2 second interval
        HWREG(CPUTIMER0_BASE + CPUTIMER_O_PRD) = 20e3 - 1;
        HWREG(CPUTIMER1_BASE + CPUTIMER_O_PRD) = 200000000 - 1;
    
        // Load optional pre-scale value
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TPR) = 0;
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TPR) = 1;
    
        // Set the mode of running
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0x800U;
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0x800U;
        
        // Enable timer interrupts
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0xC000U;
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0xC000U;
    
        // Reload period and prescale
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0x20U;
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TCR) |= (uint16_t) 0x20U;
    
    
        // Register ISRs for Timer 0 and Timer 1
        Interrupt_register(INT_TIMER0, &timer0_isr);
        Interrupt_register(INT_TIMER1, &timer1_isr);
    
        // Configure the PIE module for Timer 0 interrupt INT1.7
        HWREGH(PIECTRL_BASE + PIE_O_IER1) |= (uint16_t) 0x40U;
    
        // Enable global interrupts and configure IER
        // Enable Timer 0
        IER |= 0x1U;
        // Enable Timer 1
        IER |= 0x1000U;
        EINT;
    
        // DAC Initialization starts
        EALLOW;
    
        // DAC Reference Selection
        HWREGH(DACA_BASE + DAC_O_CTL) |= 0x0001U;
        HWREGH(DACB_BASE + DAC_O_CTL) |= 0x0001U;
    
        // DAC Load Mode
        HWREGH(DACA_BASE + DAC_O_CTL) &= 0xFFFBU;
        HWREGH(DACB_BASE + DAC_O_CTL) &= 0xFFFBU;
        
        // Power-up Buffered DAC
        HWREGH(DACA_BASE + DAC_O_OUTEN) |= 0x0001U;
        HWREGH(DACB_BASE + DAC_O_OUTEN) |= 0x0001U;
        
        // Wait for Power-up time (atleast 500us)
        DEVICE_DELAY_US(500);
        
        //initialize DACVALS
        HWREGH(DACA_BASE + DAC_O_VALS) = 0x0000U;
        HWREGH(DACB_BASE + DAC_O_VALS) = 0x0000U;
    
    	EDIS;
        // DAC Initialization ends
    
    
        // Configure GPIO pins 22, 52, and 97
        EALLOW;
        // Pin 22
        HWREG(GPIOCTRL_BASE + GPIO_O_GPAMUX2) &= 0xffffcfffU;
        HWREG(GPIOCTRL_BASE + GPIO_O_GPADIR) |= (uint32_t) 0x400000U;
    
        // Pin 52
        HWREG(GPIOCTRL_BASE + GPIO_O_GPBMUX2) &= 0xfffffcffU;
        HWREG(GPIOCTRL_BASE + GPIO_O_GPBDIR) |= (uint32_t) 0x100000U;
        HWREG(GPIOCTRL_BASE + GPIO_O_GPBCSEL3) |= (uint32_t) 0x20000U;
    
    
        // GPIO 97
        HWREG(GPIOCTRL_BASE + GPIO_O_GPDMUX1) &= 0xfffffff3U;
        HWREG(GPIOCTRL_BASE + GPIO_O_GPDDIR) |= (uint32_t) 0x2U;
        EDIS;
    
    
        // Start the timers
        HWREGH(CPUTIMER0_BASE + CPUTIMER_O_TCR) &= 0xffefU;
        HWREGH(CPUTIMER1_BASE + CPUTIMER_O_TCR) &= 0xffefU;
    
    
        // Infinite loop
        while (1) {}
    
    }
    
    //
    // End of File
    //
    

  • Hi Vijay,

    Do you have the option to change the data formatting for the array values? If the array values you are seeing are correct, then it is probably you may need to change some of the settings for the graph in CCS

    Regards,

    Peter