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/TMS320F28335: Code for 3 phase inverter

Part Number: TMS320F28335
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Dear sir;

I will desing 3 phase inverter.

I have read that examples but it is very difficult to undurstand.

C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVPM_Sensorless_2833x
C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVACI_Sensorless_2833x

Could you write simply code that include follow steps:

1. Adc(analog digital converter) configuration and use of adc. because ı will read output voltage and currunt of inverter. 

2. Matematical operation. because ı will transform abc to dq frame (park,clark translation)  for example 2/3*cos(fi)+sin(fi)......

3. Software signal generator  configuration and how to use. Because I will use 1kHz triangular signal in software (for theta (PLL)).

4. ePWM configuration and use of ePWM for SVPWM.

Best regards.

  • Unfortunately, we are not allowed to write code for customers.

    We can only offer to advise and provide directions on the forum or clarify on issues, writing code is a job/task and not a support activity.

    My apologies.

    Manish Bhardwaj 

  • Dear sir;

    Ok then; Could you help me?

    How can I simplify this code (C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVPM_Sensorless_2833x)

    For example

    I donot need that part of HVPM_Sensorless_2833x code and I can delete that part:
    #ifdef FLASH
    #pragma CODE_SECTION(MainISR,"ramfuncs");
    #pragma CODE_SECTION(OffsetISR,"ramfuncs");
    #endif

    And ı donot need eCAN,eCAP....


    And could you explain flow chart of code?

    Could you explain each step of code?

  • Only you can evaluate what is needed or not needed. I will answer the specific questions you have

    1. I donot need that part of HVPM_Sensorless_2833x code and I can delete that part:
    #ifdef FLASH
    #pragma CODE_SECTION(MainISR,"ramfuncs");
    #pragma CODE_SECTION(OffsetISR,"ramfuncs");
    #endif


    No, you will need this. An ISR is needed to execute the control loop. The above defines are used to place the code in ram for faster execution.

    2. If you do not need eCAN or eCAP you can remove as needed.

    3. C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVPM_Sensorless_2833x\~Docs

    And could you explain flow chart of code? -> See Fig on Page 16

    4. Sorry , please refer to the documentation and spend some time with it. Things will become clear. It does take time.

    Also if you are new to C2000 MCU , please refer to the C2000 MCU training

    processors.wiki.ti.com/.../C2000_32-bit_Real-Time_MCU_Training

    And dedicate a couple of days to understand the MCU.
  • I have read this documents more times.

    İt is complex .

    This is not useful and helpful. :(
  • I am sorry, I am unable to suggest anything else. As i mentioned earlier, the forum is not a work request tool, where you can request sw to be written for you. 

    I am happy to help you with any specific questions you have on the device. 

  • Why is this platform complex?

    Code is not simply. for example Ledblink

    #include "DSP2833x_GlobalPrototypes.h"
    #include "DSP2833x_EPwm_defines.h" // Macros used for PWM examples.
    #include "DSP2833x_Dma_defines.h" // Macros used for DMA examples.
    #include "DSP2833x_I2c_defines.h" // Macros used for I2C examples.


    why do we use this code. is it necessary for ledblink?

    there is no any simple code example in this platform.

    There are lots of unnecassary link connections.

    another

    why do we use below code?

    InitPieVectTable(void)
    {
    int16 i;
    Uint32 *Source = (void *) &PieVectTableInit;
    volatile Uint32 *Dest = (void *) &PieVectTable;

    EALLOW;
    for(i=0; i < 128; i++)
    {
    *Dest++ = *Source++;
    }
    EDIS;

    //
    // Enable the PIE Vector Table
    //
    PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
    }

    Another;

    SysCtrlRegs.SCSR = BIT1;

    when ı click on SysCtrlRegs.  --> volatile struct SYS_CTRL_REGS SysCtrlRegs;  and

    click on SYS_CTRL_REGS---> struct SYS_CTRL_REGS

    click on SysCtrlRegs ---> extern volatile struct SYS_CTRL_REGS SysCtrlRegs;

    click on SCSR ---->Uint16              SCSR

  • 1. Why is this platform complex?

    C2000 MCU is a feature-rich device, and the applications we are used in require the user to develop deep level of understanding of the peripherals and enable them to code for it. It's unlike "arduino" or other similar platforms where things can be abstracted for the user. 

    2. 

    Code is not simply. for example Ledblink 

    #include "DSP2833x_GlobalPrototypes.h" 
    #include "DSP2833x_EPwm_defines.h" // Macros used for PWM examples.
    #include "DSP2833x_Dma_defines.h" // Macros used for DMA examples.
    #include "DSP2833x_I2c_defines.h" // Macros used for I2C examples.


    why do we use this code. is it necessary for ledblink?

    there is no any simple code example in this platform.

    There are lots of unnecassary link connections.

    I can take this as feedback to clean the code, Also note you are looking at examples of code for a device that was released > 10 years ago. For some of our new devices we have moved to a "driver lib" method, that abstracts the inclusion of some of these files and makes it "look simpler". 

    3. 

    another

    why do we use below code?

    InitPieVectTable(void)
    {
    int16 i;
    Uint32 *Source = (void *) &PieVectTableInit;
    volatile Uint32 *Dest = (void *) &PieVectTable;

    EALLOW; 
    for(i=0; i < 128; i++)
    {
    *Dest++ = *Source++;
    }
    EDIS;

    //
    // Enable the PIE Vector Table
    //
    PieCtrlRegs.PIECTRL.bit.ENPIE = 1; 
    }

    Please go through the Picoolo training i pointed you to, we use a Pie vect table based method for the interrupt routines and the tables need to be initialized. This is explained in that training. 

    4. 

    Another;

    SysCtrlRegs.SCSR = BIT1;

    when ı click on SysCtrlRegs.  --> volatile struct SYS_CTRL_REGS SysCtrlRegs;  and

    click on SYS_CTRL_REGS---> struct SYS_CTRL_REGS

    click on SysCtrlRegs ---> extern volatile struct SYS_CTRL_REGS SysCtrlRegs;

    click on SCSR ---->Uint16              SCSR

    well, as I mentioned we use bit fields for register writes, and it does make it easy to write code for which we have to declare a volatile structure for the register space. This type of coding has been extensively used in C2000 space, also covered in the C2000 training I mentioned. Though on some new devices and going forwards we are standardizing on a driverlib type approach that is more standard in the embedded community.