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.

66AK2G12: Continuos operation with EDMA

Part Number:

Hi experts,

I am approaching to 66AK2G12x Multicore SoC and in my application I need to use the EDMA module for programming CMPA and CMPB registers without involving the DSP. 

Specifically, I want to copy data from the DSP internal memory L2 SRAM to CMPA, CMPB registers, every time ePWM_0 generates an interrupt. 

QUESTION 1

My idea is to implement the following procedure:

A) The module ePWM_0 generates the interrupt ePWM_INT_0 (that is the event 32); event 32 is served by DMA channel 32. 

B)

    B1) DMA channel 32 points to Param Set 0.

    B2) Param set 0 is served: the content of address 80'0000h is copied in CMPA register

    B3) At the end of transfer, param set 0 is chained to DMA channel 33.

C)

   C1) DMA channel 33 points to Param Set 1.

   C2) Param set 1 is served: the content of address 80'0002h is copied in CMPB register

   C3) At the end of the transfer, param set 1 is chained to DMA channel 34

D) 

   D1) DMA channel 34 points to Param Set 2.

   D2) Param set 2 is served: the content of address 80'0004h is copied in CMPA register

   D3) At the end of the transfer, param set 2 is not chained.

E) At the next ePWM_INT_0 the steps B-C-D are repeated because, differently from Linking, the Param set retained during the chaining.

 Is my understanding correct? Can this procedure work?

QUESTION 2

 

Each DMA channel points to a specific Param set in accordance with the content of the register DCHMAP.

Is it possible to write the register DCHMAP by means of EDMA MODULE?

For example:

   1) The content of L2 SRAM 80'0000h contains the address of Param set 1 

   2) The module ePWM_0 generates the interrupt ePWM_INT_0 that is served by DMA channel 32. 

   3) DMA channel 32 points to Param Set 0.

   4) Param set 0 is served:  the content of address 80'0000h is copied in DCHMAP_33

   5) At the end of transfer, DMA channel 33 points to Param set 1

Thanks for your support.

Best Regards,

Benito

 

  • Benito Carotenuto said:

    Part Number: 66AK2G12

    Hi experts,

    I am approaching to 66AK2G12x Multicore SoC and in my application I need to use the EDMA module for programming CMPA and CMPB registers without involving the DSP. 

    Specifically, I want to copy data from the DSP internal memory L2 SRAM to CMPA, CMPB registers, every time ePWM_0 generates an interrupt. 

    QUESTION 1

    My idea is to implement the following procedure:

    A) The module ePWM_0 generates the interrupt ePWM_INT_0 (that is the event 32); event 32 is served by DMA channel 32. 

    B)

        B1) DMA channel 32 points to Param Set 0.

        B2) Param set 0 is served: the content of address 80'0000h is copied in CMPA register

        B3) At the end of transfer, param set 0 is chained to DMA channel 33.

    C)

       C1) DMA channel 33 points to Param Set 1.

       C2) Param set 1 is served: the content of address 80'0002h is copied in CMPB register

       C3) At the end of the transfer, param set 1 is chained to DMA channel 34

    D) 

       D1) DMA channel 34 points to Param Set 2.

       D2) Param set 2 is served: the content of address 80'0004h is copied in CMPA register

       D3) At the end of the transfer, param set 2 is not chained.

    E) At the next ePWM_INT_0 the steps B-C-D are repeated because, differently from Linking, the Param set retained during the chaining.

     Is my understanding correct? Can this procedure work?

    QUESTION 2

     

    Each DMA channel points to a specific Param set in accordance with the content of the register DCHMAP.

    Is it possible to write the register DCHMAP by means of EDMA MODULE?

    For example:

       1) The content of L2 SRAM 80'0000h contains the address of Param set 1 

       2) The module ePWM_0 generates the interrupt ePWM_INT_0 that is served by DMA channel 32. 

       3) DMA channel 32 points to Param Set 0.

       4) Param set 0 is served:  the content of address 80'0000h is copied in DCHMAP_33

       5) At the end of transfer, DMA channel 33 points to Param set 1

    Thanks for your support.

    Best Regards,

    Benito

     

    Benito Carotenuto said:

    Part Number: 66AK2G12

    Hi experts,

    I am approaching to 66AK2G12x Multicore SoC and in my application I need to use the EDMA module for programming CMPA and CMPB registers without involving the DSP. 

    Specifically, I want to copy data from the DSP internal memory L2 SRAM to CMPA, CMPB registers, every time ePWM_0 generates an interrupt. 

    QUESTION 1

    My idea is to implement the following procedure:

    A) The module ePWM_0 generates the interrupt ePWM_INT_0 (that is the event 32); event 32 is served by DMA channel 32. 

    B)

        B1) DMA channel 32 points to Param Set 0.

        B2) Param set 0 is served: the content of address 80'0000h is copied in CMPA register

        B3) At the end of transfer, param set 0 is chained to DMA channel 33.

    C)

       C1) DMA channel 33 points to Param Set 1.

       C2) Param set 1 is served: the content of address 80'0002h is copied in CMPB register

       C3) At the end of the transfer, param set 1 is chained to DMA channel 34

    D) 

       D1) DMA channel 34 points to Param Set 2.

       D2) Param set 2 is served: the content of address 80'0004h is copied in CMPA register

       D3) At the end of the transfer, param set 2 is not chained.

    E) At the next ePWM_INT_0 the steps B-C-D are repeated because, differently from Linking, the Param set retained during the chaining.

     Is my understanding correct? Can this procedure work?

    QUESTION 2

     

    Each DMA channel points to a specific Param set in accordance with the content of the register DCHMAP.

    Is it possible to write the register DCHMAP by means of EDMA MODULE?

    For example:

       1) The content of L2 SRAM 80'0000h contains the address of Param set 1 

       2) The module ePWM_0 generates the interrupt ePWM_INT_0 that is served by DMA channel 32. 

       3) DMA channel 32 points to Param Set 0.

       4) Param set 0 is served:  the content of address 80'0000h is copied in DCHMAP_33

       5) At the end of transfer, DMA channel 33 points to Param set 1

    Thanks for your support.

    Best Regards,

    Benito

     

    Hi,

    The steps mentioned by you may not result the desired behavior. Once the param set in step D3 is executed, all the values of ACnt, BCnt and CCnt within those paramsets will become 0 and on next interrupt of EPWM, the count values are invalid. Hence the intended output will not be seen. The data trasnfer from RAM to CMPA/CMPB happen only once and does not happen from next iteration.

    I was also trying to achieve similar using EDMA and SPI interfaces. Our requirement was to send 24bytes of data to ADC connected on SPI periodically without intervention of DSP. I could not achieve the same and still working and waiting for a reply from TI.

  • Dear Mr. Nagaraju,

    thanks for your reply. 

    My aim is to write the CMPA and CMPB values of the module EPWM without engaging the DSP; hence, I want to involve the EDMA module.

    I plan to use CHAINING instead of LINKING in order to retain the setting of the paramset after transfer completion.

    Specifically, as from TRM, when param set is configured with LINK=FFFFh and OPT.STATIC=0h, at the end of the transfer all the fields in paramset shall be zeroed; consequently, the "linking procedure" stops. 

    On the other hand, I want  to program 3 param-sets: every time the EPWM module generates an interrupt to the EDMA, the EDMA performs the transfer from L2 SRAM to CMPA/CMPB registers. Consequently, I focused on the CHAINING mechanism with OPT.STATIC=1h to preserve the fields of paramset for the next interrupt.

    Is there a configuration to preserve the paramset for a next transfer, without engaging the DSP?

    In addition, I would like to know if EDMA can be configured to transfer data from L2 SRAM to DCHMAP registers.

    I hope that other experts can help me.

    Thanks for your feedback,

    Benito

  • Hi,

    any other feedback concerning my question?

    Thank you.

    Benito

  • Hi Benito, Nagaraju,

    Sorry for late response to your questions. 

    You were talking about these two features of the EDMA3: linked transfers and chain-triggered transfers. I hope it is clear to you that these two features are totally different:

    • Linked transfer: upon current transfer completion, the PaRAM set is reloaded, but a new transfer is not initiated. Please refer to section 2.3.7 (Linking Transfers) of the EDMA3 Controller User's Guide.
    • Chain-triggered transfer: one of 3 ways to initiate a DMA transfer. Upon current transfer completion, it initiates another transfer, but does not modify or update the PaRAM set. Please refer to section 2.8 (Chaining EDMA3 Channels) of the EDMA3 Controller User's Guide

    Nagaraju,

    For your application, please refer to section 3.4 (Peripheral Servicing Example) of the EDMA3 Controller User's Guide. It is doable.

    Benito, 

    For your application, you'll need to use combined link and chain operation. Please refer to this post for reference: https://e2e.ti.com/support/processors/f/791/t/414197. It should be doable.

    But I wouldn't use this approach unless the link or/and chain operations can't achieve the purpose.

  • Dear mr. Jianzhongxu,

    thank you for your suggestion!

    I have a further question:

    Can the user write in the channel destination address of a paramset the address of DCHMAP? That is, can the DMA be programmed to write the DCHMAP?

    Thank you,

    Benito

  • Hi Benito,

    Yes, you should be able to use DMA to write DCHMAP registers because they are memory-mapped. 

    Regards,

    Jianzhong