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.

LAUNCHXL-F28379D: Issue Syncro SPI if slave is in CCS debug

Part Number: LAUNCHXL-F28379D

Hi,

In my application for each PWM period (4 Khz) the slave acquires 4 voltage (4 channel ADC) and send them to the master through 4 comunication SPI (NO FIFO, 4 wires, HS disable).

The master read the 4 voltages and calculates 2 duty cycle, then send them to the slave through 2 communication SPI.
The master is in CCS debug.

Now the problem is: if slave run by flash memory it work fine, if slave run by CCS debug for the first few seconds communication works well then after a few seconds it is no longer synchronous, if voltage communication is correct then dutycycle communication isn't correct and vice versa.


Can anybody help me understand the reason?

p.s: Master and Slave are LAUNCHXL-F28379D

  • Hi Biagio,

    Just to confirm I understand the issue correctly- if you boot the part from flash without an emulator connected, the code works as expected. But if you have the emulator connected and you are running from CCS, the data becomes invalid. Is that correct?

    Do you have any waveforms of the transactions?

    Regards,
    Kris
  • Yes, if I boot the slave from flash (the master is always running from CCS ) the code works as expected. if I have the slave connected and running from CCS, the comunication SPI is wrong.

    I haven't waveform of communications, but I can read from the master the measures sent by the slave.

    For example, If the tensions I apply to the system with the generators are V[0]=100 V, V[1]=250V, V[2]=400 V, V[3]=600 V, and the duties I send from master to slave are d[0]=0.3, d[1]=0.8,
    If i boot slave from flash, from debugging the master and oscilloscope connected to the slave pwm, all is ok, but if slave run from CCS I have the following random situation:
    1)the measurements sent to the master are wrong and are V[0]=0; V[1]=100 V, V[2]=250V, V[3]=400 V and the duty are correct
    2)the measurements are ok but the duty cycle sent are wrong and are d[0]=0, d[1]=0.3, I see this also from the oscilloscope connected to the slave pwm.

    I have to understand the reason for erroneous communication because the DSPs control a H-Bridge structure of 500 kVA and if the microcontrollers fail during operation it is really very dangerous for everything and everyone.

    Regards,
    Biagio
  • Biagio,

    A few questions come to mind:

    How are you syncing the devices when running with the emulator? For example, could your master be sending data before your slave is ready? Remember a device may boot differently when the emulator is connected.

    What does the flow look like from CCS? Start master then start slave?

    How are you verifying this is an issue with the SPI data as opposed to a PWM frequency issue or something along those lines?

    Regards.
    Kris
  • I am sure the slave is ready when the master sends the data, I start (play from CCS) the master and the slave together but the first time the master waits 10 seconds before starting the algorithm and SPI communication. In addition, the slave performs only 4 acquisitions and 6 spi communications (nothing else), but the master performs the following operations: 8 acquisitions, small algorithm, 4 spi communications with the slave (MODULE B) and other 4 communications with another slave (MODULE A), small algorithm, 2 communication spi (MODULE B) and other 2 communications (MODULE A) with another slave , small algorithm.

    The problem is not due to the frequency pwm. The PWM frequency is 4 kHz => every 250 micro seconds the routine is repeated,
    6 comunication spi = 42 microsec
    Algorithm = 120 microsec
    8 Acquisition < 15 microsec
    Tot= 177 microsec


    The only thing that comes to my mind is that somehow the SPI - A module of the master, used to communicate with another slave (this slave is always started by flash and use its module SPI - A) interferes with the SPI - B module of the master used with this slave.

    MASTER SPI A <=> SLAVE1 SPI - A (no communication problems)
    MASTER SPI B <=> SLAVE2 SPI - A (yes communication problems)
  • Hi,
    I solved the problem. The problem is related to electromagnetic compatibility. When I move the microcontroller to connect it to the pc, in the new position the microcontroller is closer to the H-bridge (at low system voltage the spi communication still works well).

    I will replace the cables used for SPI communication with shielded cables to ensure that in the standard microcontroller position there are no electromagnetic compatibility problems at high-voltage.

    Regards,
    Biagio