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.

EVMK2G: EDMA triggered by EPWM

Part Number: EVMK2G

Hi experts,

For my work I developed a bare metal code on the evaluation board EVMK2G that is loaded in the DSP C66x by means of the on-board debugger TI XDS2xxx.

I downloaded the ti-processor-sdk-rtos-k2g-evm-06.03.00.106-Windows-x86-Install.exe and I installed CCS10.2

I programmed the channel 35 of the module EDMA 1 to copy data from the memory L2SRAM to the register EPWM3_CMPA. 

My code works fine if I start the copy by means of the manual trigger ( that is writing 0x8 within the register ESRH).

Next step is to trigger the EDMA module without requiring any DSP intervention, as suggested by the section 10.4.4 of the TRM SPRUHY8I. 

I succesfully achieved this goal on microcontroller TMS320F2807x because each DMA channel is associated to a specific signal EPWM_SOCA/B.

I need to replace this behaviour on EVMK2G. However, in the sync event list of the table 10-8, there are not the SOCA/SOCB signals. It seems that the EDMA can be triggered by EPWM only by means of the interrupts.

How can I trigger the module EDMA by means of the module EPWM, without the intervention of the DSP?

Thank you in advance.

Best regards,

Benito Carotenuto

  • Hi Benito,

    Our RTOS expert is out of office this week. Please expect delayed response.

  • Dear mr. Bin Liu,

    thank you for your answer.

    I'll wait for the expert to return. 

    A little clarification: my code is bare-metal; I programs the device through the CSL library functions. 

    I do not know how to connect the EDMA channels with the signals SOCA/B within the EPWMx module.

    Indeed, in my current code version the PWM sets the signals SOCA/B but this event does not trigger the proper bit in the event register of EDMA module.

    There is no mention of SOCA/B within the section 10.2.1 of the TRM SPRUHY8I.

     

    According the following post: 

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/997683/66ak2g12-epwm-hrctl-register?tisearch=e2e-sitesearch&keymatch=epwm%2520edma#

    It seems that is possible to trigger the EDMA by means of SOCA/B signals of the EPWMx (as I succesfully did on TMS320F2807x). 

     

    I'll wait for a feedback from this forum.

    Thank you for the support.

    Benito Carotenuto

  • Hello Benito Carotenuto,

    In the thread you referenced, I believe EPWM is configured to generate an interrupt based on SOCA and the interrupt triggers EDMA:

    • EPWM_ETSEL Register = 0x900: Enable SOCA pulse, Enable event time-base counter equal to zero
    • EPWM_ETPS Register = 0x500: Generate an interrupt on the first event INTCNT = 01, ePWM Interrupt Event (EPWMx_INT) Counter Register = 1

    Regards,

    Jianzhong

  • Dear mr. Jianzhong Xu,

    thank you for your feedback.

    The registers you mentioned enable the generation of SOCA/B signals in EPWM module.

    How can I connect the EDMA channels to this signals?

    In accordance with the table 10-8 of TRM SPRUHY8I, the EDMA channels 32-37 are associated only to the EPWM_x_INT

    There is no mention of the signals SOCA/B within this sync events list.

    For example, what is the number of the channel that is triggered by the signal EPWM1_SOCA ?

     

    Thank you,

    Benito

  • Dear experts,

    any news about my question?

    Waiting for a your feedback,

    Best regards.

    Benito

  • Each EPWM module produces 2 DMA events INT and TRIP_ZONE (see figure 11-350 in the TRM).  Table 11-794 shows which events are mapped to DMA event numbers.   The start of conversion signals do not directly go to the DMA block.  You will have to setup the EPWM module to produce interrupts when SOC events occur.  See the EPWM chapter for more details

    Regards,

    james

  • Dear James,

    thank you for your feedback.

    You will have to setup the EPWM module to produce interrupts when SOC events occur.

    I understand that the signal EPWMX_SOCA/B can not directly trigger the EDMA channels because of the layout of the SOC. Hence,  it is necessary to produce the EPWM interrupts.


    According Table 11-909 of TRM,  an important difference between the EPWMx_INT and EPWMx_SOCA/B is the flag bit

    The EPWMx_SOCA/B output will continue to pulse even if the flag bit in EPWM_ETFLAG is set.

    The EPWMx_INT output instead set the flag bit to 1 and no further interrupts will be generated until the flag bit is cleared. Up to one interrupt can be pending while the EPWM_ETFLG[0] INT bit is still set. If an interrupt is pending, it will not be generated until after the EPWM_ETFLG[0] INT bit is cleared.


    Consequently, every time the interrupt triggers the EDMA, the DSP must clear the bit EPWM_ETFLAG[0] by means of  register EPWM_ETCLR[0] in order to allow the next interrupt generation.

    Therefore, the EPWM module can not trigger the EDMA without the intervention of DSP. Afterwards each transfer from L2SRAM to CMPA/B, the DSP must clear the ETFLAG[0]...

    For my work I want to use the capability of the module EDMA to continuously copy values from L2SRAM to the EPWMx_CMPA/B registers without the intervention of DSP.

    Unlike the Piccolo (TMS320F2807x), this is not possible with EVMK2G. 

    Is my comprehension right?

    Thank you.

    Best regards,

    Benito

  • I think you should be able to setup 2 DMAs which are linked.  The first DMA would perform the data transfer as you mention, then the second DMA could be simply one write that clears the flag.  These DMAs could be linked so the 2nd DMA (with the signal write) starts after the first DMA completes.

    Regards,

    James