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: Problem Regarding IPCSENDDATA

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

I'm trying to control an Induction motor model through IPC registers. What I have done so far is, I have generated a v/f voltage in CPU1 and an Induction Machine Model in CPU2. I'm trying to transfer my voltage from CPU1 to CPU2 through IPC SENDDATA, SENDADDR,SENDCOM to the other CPU. Here is the code for both the cores.

CPU1 (v/f)

 IpcRegs.IPCSENDDATA = (float32) Va;       // Write the result to the IPC data register
 IpcRegs.IPCSENDADDR = (float32) Vb;
 IpcRegs.IPCSENDCOM  = (float32) Vc;

 IpcRegs.IPCSET.bit.IPC4 = 1;              // Set the IPC4 flag for CPU2

CPU2(IM Model)

//--- Read the 3-Phase voltages from IPC4
    v_a = (float32) IpcRegs.IPCRECVDATA;
    v_b = (float32) IpcRegs.IPCRECVADDR;
    v_c = (float32) IpcRegs.IPCRECVCOM;

//--- Manage the IPC registers
    IpcRegs.IPCACK.bit.IPC4 = 1;                    // Clear IPC4 flag

The issue is none of the registers (SEND registers in CPU1 and RECV registers in CPU2) are updating. All are showing zero. One more issue is, even though I have given the type as float32, it is showing unsigned long in watch window. I have confusions in setting the master for the message RAM and GS RAM. Can anyone please help me to resolve these problems?

Thanks and regards

Aruni J

  • Hi Aruni,

    All the IPC registers are defined as uint32 type. So, if you try to write a float variable to these registers, the compiler will automatically convert them to integer. So, if the variable values are less than 1, the register will be written with a value 0.

    You can either change the IPC registers struct definition and define the IPC registers as float32 type, or you can define float32 variables in IPC MSGRAM or GSRAM and share the address with the other core

    You need not set the master core for Message RAM. There are dedicated message RAMs for CPU1 to CPU2 and CPU2 to CPU1. GSRAM needs to be assigned to a specific core before using it. You need to set the GSxMSEL register for assigning the master. You can refer to the example RAM_management in C2000Ware\device_support\f2837xd\examples\dual


    Regards,

    Veena

  • Thank you so much for your reply. The explanation is so understanding. I have one doubt in it. If I'm sharing the address after defining a variable in IPC MSGRAM or GSRAM, then according to the procedure explained in the TRM, I can send only one variable at a time, because all the three registers (SENDDATA,SENDADDR and SENDCOM) are used in the procedure for different purposes (please correct me if I'm wrong). But here I have to send three variables. So, will that work with sharing memory?

    Thanks and regards

    Aruni J 

  • I will definitely try the other method and let you know about the status.

    Thank You

  • Hi Aruni,

    You can define an array in the GS RAM or IPC MSG RAM and pass the base address as SENDADDR and the length of the array as SENDDATA.

    Although the IPC command registers are named as SENDDATA,SENDADDR and SENDCOM, you can treat them as 3 different 32 bit registers shared between cores. It is not necessary that  you need to send a data, address and command in these registers. You can even pass 3 different addresses as SENDDATA,SENDADDR and SENDCOM as well. It is flexible as per your need,

    Regards,

    Veena

  • Hi Veena,

    I think you misunderstood my question. I want to send 3 variables at a time. My variables are 3 phase voltages. Is it possible by defining an array in memory and sharing the address and length through SENDADDR and SENDDATA?

    Regards

    Aruni J

  • Yes, You can do that

    Regards,

    Veena