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-F28027F: Phase shift and synchronization over SPI bus to other launchpads

Part Number: LAUNCHXL-F28027F

Hi forum,

For my masterthesis I'am using the LAUNCHXL-F28027F with Simulink Matlab to implement my control algorithm. What want to do is having one LAUNCHXL-F28027F as a master device, it will be connected by an SPI bus to multiple LAUNCHXL-F28027F in a daisy chain. For the application it is important that they are synchronized and have a determined phase shift to each another. So I thought I approach my problem step by step by only using one LAUNCHXL-F28027F and control the PWM1 and PWM2. The was in a first step to synchronize them and then add a phase shift. I set up the following model in Simulink for the MCU:

I control the frequency, duty cycle etc trough the SCI communication bus from my laptop with the following model:

When the model is running I can adjust everthing apart of the phase shift of the PWM channels. here are the settings of the PWM blocks:

What am I doing wrong? and for the next step how can I proceed the Synco trough SPI to the other MCU?

Thank you for your help!

Best regards,

Oliver

  • Oliver,

    I am not quite sure I understand what you are attempting to do. The PWMSCYNCI/O signal is not tied to the SPI as far as I am aware.

    You wish to trigger a PWM SYNC with the SPI?

    Thanks,
    Mark
  • Hi Mark,

    Thank you for your help. I want to use one launchpad as a master device which sends the counter trigger over the SPI bus to other launchpad to synchronize them every so often. The problem I have is that the ePWM block has no output of that SYNCO to feed that signal into the SPI bus. Is there another way to synchronize other "slave" launchpads?

    Thank you,
    Best regards,
    Oliver
  • Oliver,

    Correct. the SPI cannot be triggered by the EPWMSYNCI/O signal.

    You could just wire up the EPWMSYNCI and EPWMSYNCO signals between your boards. EPWMSYNCI is available at J6.7, J2.6 and J2.8. EPWMSYNCO is available at J6.8, J2.7, and J2.8. Using this approach will be more deterministic rather than relying on the SPI interrupts and delays that may occur if a SPI message comes in at a time that is not able to be handled immediately.

    Does this make sense?

    -Mark
  • Hi Mark,

    Thank you for your help.

    The problem is that I still will use the SPI for duty cycle and other information, therefore J6.7, J6.8, J2.6 and J2.7 cannot be used. The only pin therefore is J2.8 but i getting now signal out of the pin if I measure it with the oscilloscope. What could be the problem?

    Here the setup on Simulink:

    Thank you for your help!

    Best regards,

    Oliver

  • Oliver,

    It would probably be most helpful if you share a pin map/ hw drawing to see how you have your system connected.  What signals do you need? what signals are you using? Can you explain a bit more what you are trying to do? What signal is not showing up?

    You can actually split GPIO32 from GPIO16, and also GPIO33 from GPIO17. Look at JP4 through JP11  in the schematic. These are conveniently placed so you can cut the traces. Modify the hardware as follows:

    Pin Signal desired at Pin cut this jumper
    J2.6 GPIO16 (SPISIMO) JP5
    J2.7 GPIO17 (SPISOMI) JP7
    J6.7 GPIO32 (EPWMSYNCO) JP8
    J6.8 GPIO33 (EPWMSYNCI) JP10

    Additionally, if you have any MATLAB or Simulink questions it would be best to contact their support network. Without seeing the generated C code, it is very difficult to know exactly how the device is configured as we are not Simulink experts here.

    Thanks,

    Mark

  • Hi Mark,

    Sorry for my late response. The solution was a lot simpler. I had to go into the hardware configuration and assign the pin. Otherwise it wont work. I experienced similar problems and I am running into problems with scheduling again.

    At the end it is my problem as I am really bad in C programming and not an embedded programmer. But it would help me a lot if there would be a good manual for the Simulink TI programming. 

    I thank you again for you excellent support!

    Best regards,

    Oliver