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.

CCS/TMS320C6748: EDMA3

Part Number: TMS320C6748
Other Parts Discussed in Thread: ADS4245

Tool/software: Code Composer Studio

I'd like to use EDMA3 on two 16-bit GPIO input data words. After reading about EDMA3, it seems straightforward, but I am not sure whether the volatile aspect of input data may preclude using EDMA3.  Specifically, the two 16-bit values are coming from ADS4245.  The goal is to transfer them to memory.  My question is if I specify the element size 2, will EDMA3 read the 16 bit quantity so that volatility aspect does not interfere withe correct reading.  Please explain.

thanks.

  • Additional question:

    EDMA3 is n to n  transfer.  What I am trying to achieve is 1 to n transfer.  Is there a trick to do this?  Specifically, I'd like to be able to read a 16 bit port 16 times consecutively and transfer to contiguous 16 16-bit memory locations.

  • Hey Peter,

    Yes, it is possible to do a 1 to n transfer using EDMA3 by setting up the count and index values appropriately.

    You can do so by setting SRCBIDX = 0; DSTBIDX = 2; SRCCIDX=0; DSTCIDX=0 and ACNT=1; BCNT = #transfers and CCNT=0 with size as 2 and transfers triggered by your peripheral in A-Synchronized Transfer mode.

    For more details, I'd refer you to https://training.ti.com/using-c6000-edma3-overview-12-15?cu=1134423 and the three following videos as well as the EDMA3 user guide SPRUGS5B

  • Thanks, but follow up questions:

    ACNT = 2 for my context as the value read is 16 bits wide.

    Shouldn't CCNT = 1?

    Please clarify what is meant by "CCNT=0 with size as 2 and transfers".

  • Peter,

    Were you able to setup the EDMA transfer on C6748 for your GPIO input based on guidance from Sudhanshu or do you need further assistance with this issue. 

    For 16 bit transfer, set ACNT=2, CCNT =1 and BCNT to number of 16 bit words to read with SRCIDX = 0 and DSTIDX =2 and bcntreload=0.  CCNT holds the number of frames of aCnt*bBcnt bytes to be transferred so it has to be set to 1 and not 0 as per my understanding.

    Regards,

    Rahul

  • Thanks.  I haven't tried it yet.

  • Finally got around to trying QDMA.  Didn't work :(

    My scheme is as follows;

    Use QDMA channel 0 to read from a 16-bit GPIO port 16 times and save the readings in an array of 16-bit words.

    After POR, I set it up as follows:

    // PaRAM Block

    #define PaRAM_START 0x01c04000
    #define PaRAM_SET_0 0x4000
    #define PaRAM_SET_1 (PaRAM_SET_0 + 32)
    #define PaRAM_SET_2 (PaRAM_SET_1 + 32)
    #define RF_IN (SOC_GPIO_0_REGS + 0x70)
    #define NO_LINK 0XFFFF

    #define QCHMAP0 0x01c00200
    #define QER 0x01c01080
    #define QEER 0x01c01084
    #define QEECR 0x01c01088
    #define QEESR 0x01c0108c

    #define IER 0x01c01050
    #define IECR 0x01c01058
    #define IESR 0x01c01060
    #define IPR 0x01c01068
    #define ICR 0x01c01070
    #define RFDMA_READY (HWREG(IPR) & 0x00000001)

    struct __attribute__((__packed__)) T_PaRAM {
    // keep declaration order below!
    uint32 opt;
    uint32 src;
    uint16 acnt;
    uint16 bcnt;
    uint32 dst;
    uint16 srcbidx;
    uint16 dstbidx;
    uint16 link;
    uint16 bcntrld;
    uint16 srccidx;
    uint16 dstcidx;
    uint16 ccnt;
    uint16 rsvd;
    };

    int16 RF_READINGS[16];

    #pragma LOCATION(data_PaRAM, PaRAM_START)
    struct __attribute__((__packed__)) T_PaRAM data_PaRAM;
    //=============================================================================

    bool QDMA_Done() {
    return (RFDMA_READY);
    }

    //=============================================================================

    void InitQDMA() {


    int i;
    for (i=0;i<16;i++) {
    RF_READINGS[i] = 0;
    }

    //enable QDMA Ch 0
    HWREG(QEESR) = 0x00000001;
    //clear interrupt status
    HWREG(ICR) = 0x00000001;
    //set interrupt enable
    HWREG(IESR) = 0x00000001;
    // initialize PaRAM Set 0
    data_PaRAM.src = RF_IN;
    data_PaRAM.acnt = 2;
    data_PaRAM.bcnt = 16;
    data_PaRAM.srcbidx = 0;
    data_PaRAM.dstbidx = 2;
    data_PaRAM.bcntrld = 0;
    data_PaRAM.srccidx = 0;
    data_PaRAM.dstcidx = 0;
    data_PaRAM.ccnt = 1;
    data_PaRAM.dst = (uint32) &RF_READINGS;
    data_PaRAM.link = NO_LINK;
    // trigger word; must be the last assignment statement in the function
    data_PaRAM.opt = 0x00100008; //TCINTEN=1, STATIC=1
    }
    Then, in an while(1) loop, I call QDMA_Done() to check the bit 0 of IPR.  If it's set, I process the data.  Then, InitQDMA() is called to repeat the procedure.  It does not seem to work yet.  What seems to be missing or incorrect?

  • To debug, I'm monitoring the QDMA registers in the CCS but I don't see their contents change.

  • QDMA setup I created does not work.  Need help.

  • please see my replies for details on issue I am experiencing.

  • Took a step forward.  After enabling power module for EDMA3 in C6748 DSP, I was able to set QEER.0 by setting QEESR.0 to 1.  When the trigger word (OPT in my case) written as the last item in the PaRAM, nothing happened.

  • Peter,

    I am closing your issue here since your issue is resolved here:

    https://e2e.ti.com/support/processors/f/791/p/824566/3053446#3053446

    Regards,

    Rahul