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.

F28069 DMA transfer triggered by SOC

Other Parts Discussed in Thread: CONTROLSUITE

I am trying to configure the DMA to transfer my ADC results into a known buffer location as triggered by an ePWM SOC pulse. An an interim step I am attempting to simply transfer one buffer's values into another buffer (similar to the behavior of the  "dma_ram_to_ram_C28.c" example), but triggered by an SOC pulse. 

However, the transfer is not occurring. When I manually trigger the DMA the transfer occurs. When I setup the DMA to transfer according to a CPU timer, the transfer occurs. But not when I set it up to trigger on the SOC pulse.

If I monitor the PWM registers during runtime I see that the SOC flag is being set. 

Here are some relevant code snippets:

---------------------------------------------------------------------------

EPwm4Regs.ETSEL.bit.SOCBSEL = ET_CTRU_CMPB; // SOCA on counting up to CMPB

EPwm4Regs.ETSEL.bit.SOCBEN = 1; // Enable SOCA
EPwm4Regs.ETPS.bit.SOCBPRD = ET_1ST; // Generate SOCA on every event

// configure the DMA burst settings
DMACH1BurstConfig(0,2,2);
DMACH1TransferConfig(31,2,2);
DMACH1WrapConfig(0xFFFF,0,0xFFFF,0);

// Use timer0 to start the transfer.
// This is a static copy use one shot mode, so only one trigger is needed
// Use 32-bit mode to decrease transfer time
// Enable the PIE interrupt for the DMA channel
DMACH1ModeConfig(DMA_EPWM4B,PERINT_ENABLE,ONESHOT_ENABLE,CONT_DISABLE,
SYNC_DISABLE,SYNC_SRC,OVRFLOW_DISABLE,THIRTYTWO_BIT,
CHINT_END,
CHINT_DISABLE);

// Start the DMA

StartDMACH1();

--------------------------------------------------------------------------------

Any obvious things to check? Or helpful debug tips?

Thanks,

Nick

  • Hi,

    it may or may not be the case for you but I just found that some of the macro defined in F2806x_Dma_defines.h is wrong.

    It defines for DMA_EPWM1A as 18 but in the datasheet it clearly states that you cannot trigger DMA using EPWM1.

    and if you look at the reference manual for DmaRegs.CH1.MODE.bit.PERINTSEL bits, putting 18 in here will select DMA_EPWM2A.

    So you may think you have selected the trigger source to be EPWM4B but you might be actually selecting EPWM5B. Easy to check the value DMA_EPWM4B matches up with the reference manual.

    Hope TI will fix this up soon. This caused me a headache for a bit..

    Thanks

  • Ayaka, Nick,


    I am looking into this right now. We are checking our documentation as to what the proper triggers are. 

    Nick, for the time being please try what Ayaka has mentioned and let me know what you find. I should have something confirmed here in the next day or two.

    Thanks,

    Mark

  • Ayaka, Nick,

    The TRM and Datasheet are correct. This information is also on page 20 of the F2806x Errata  The Triggers for the DMA are EPWM2SOCA through EPWM7SOCB. The F2806x_Dma_defines.h file has the incorrect #defines for EPWM. The table below shows the mapping of the DMA trigger to its source. The "Actual DMA Trigger" column is the proper mapping.

    I have submitted this to the ControlSuite team to make sure this is fixed for the next release.

    If you have any more questions, don't hesitate to post!

    Thanks,
    Mark

  • Ayaka and Mark, 

    Thanks, yes it did turn out that the errata was the source of my problems. I had tried EPWM1 as a trigger source as well as EPWM4, but because of the incorrect defines I wasn't really using either one of those SOC sources. 

    Thank you for your help!

  • Great! I'm glad we could help. This should be fixed soon, so hopefully nobody will have to worry about this in the future.

    -Mark