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.

C6455 dsk_app understanding



Hello,

I have hard time to understand dsk_app example. In the PaRAM settings, I found these number:

0x02900000, 0x02900004

0x4800, 0x4820, 0x4840, 0x4860

I did look for these numbers in spru966b but couldn't find them. Where should I find documents for those number? Do I have to do some calculation to get them?

Thanks,

Pete.

  •  

    0x02900004 is the address of DXR. Please see page 11 of the http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru580g

     

    And page 189 of the datasheet:

    http://www.ti.com/lit/gpn/tms320c6455

     

    In the Param, it is the destination where the EDMA should put the data. Please see page 31 of:

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru966b

     

    Similarly, 0x02900000 is the sources address for the receive channel.

     

    The values 0x4800, 0x4820, 0x4840, 0x4860 are the low significant part of the address for the LINK Param Channel. Please see page 29 of:

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru966b

     

    To understand linking, please read the above document – specially paged 35 and 38.

  • Thanks for your specific references.

    I have another question here:

    This is the code snippet in dsk_app:

    /* PaRAM settings for sets 13 (receive) and 65 (receive ping reload) */
    CSL_Edma3ParamSetup gParamSetupRcvPing = {  // PaRAM Set Structure for receive ping buffer
        CSL_EDMA3_OPT_MAKE                      // option -      OPT
            (CSL_EDMA3_ITCCH_DIS,     \
            CSL_EDMA3_TCCH_DIS,       \
            CSL_EDMA3_ITCINT_DIS,     \
            CSL_EDMA3_TCINT_EN,       \
            15, CSL_EDMA3_TCC_NORMAL, \
            CSL_EDMA3_FIFOWIDTH_NONE, \
            CSL_EDMA3_STATIC_DIS,     \
            CSL_EDMA3_SYNC_A,         \
            CSL_EDMA3_ADDRMODE_INCR,  \
            CSL_EDMA3_ADDRMODE_INCR),
        (Uint32)0x02900000,                     // srcAddr -     SRC
        CSL_EDMA3_CNT_MAKE(2,BUFFSIZE),         // aCntbCnt -    (ACNT, BCNT)
        (Uint32)&gBufferRcvPing,                // dstAddr -     DST
        CSL_EDMA3_BIDX_MAKE(0,2),               // srcDstBidx -  (SRCBIDX, DSTBIDX)
        CSL_EDMA3_LINKBCNTRLD_MAKE(0x4800, 1),  // linkBcntrld - (LINK, BCNTRLD)
        CSL_EDMA3_CIDX_MAKE(0,0),               // srcDstCidx -  (SRCCIDX, DSTCIDX)
        1                                       // cCnt -        CCNT
    };

     

    In the comment:

    /* PaRAM settings for sets 13 (receive) and 65 (receive ping reload) */

    it said this is setting for set 65 but in http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru966b, page 29

    0x4800 is the address of PaRAM set 64. I was confused here.

     

    Also, I don't understand this:

    CSL_EDMA3_LINKBCNTRLD_MAKE(0x4800, 1),  // linkBcntrld - (LINK, BCNTRLD)

    As compare to another similar one in Edma_ping_pong_xfer_gbl_reg.c file:

    myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamPong,0);

    can I change it to:

    CSL_EDMA3_LINKBCNTRLD_MAKE(0x4820, 0),  // linkBcntrld - (LINK, BCNTRLD)

    What is the role of BCNTRLD? I couldn't understand what was written in spru966b

    "The count value used to reload BCNT when BCNT
    decrements to 0 (TR is submitted for the last array in
    2nd dimension). Only relevant in A-synchronized
    transfers."

     

    Thank you very much for your help.

    Pete.

  • Hi Pete,

    Pete said:

    In the comment:

    /* PaRAM settings for sets 13 (receive) and 65 (receive ping reload) */

    it said this is setting for set 65 but in http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru966b, page 29

    0x4800 is the address of PaRAM set 64. I was confused here.

    The table that is being configured is the number 65, and 65 links to the 64. So when the transfer described by 65 finishes, the one described by 64 is loaded and starts. You can see that 65 points to 64, and 64 points to 65 - like a ping pong.

    Pete said:

    Also, I don't understand this:

    CSL_EDMA3_LINKBCNTRLD_MAKE(0x4800, 1),  // linkBcntrld - (LINK, BCNTRLD)

    As compare to another similar one in Edma_ping_pong_xfer_gbl_reg.c file:

    myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamPong,0);

    Please look at the file ...\dsk6455_v2\csl_c6455\inc\csl_edma3.h, it has the definition of the macro CSL_EDMA3_LINKBCNTRLD_MAKE. It makes the correct entry to be loaded in the PaRam - it just put the correct values/bits in the correct position (shifting the bits). See the definition of CSL_FMK in ...\dsk6455_v2\csl_c6455\inc\cslr.h.

    Pete said:

    can I change it to:

    CSL_EDMA3_LINKBCNTRLD_MAKE(0x4820, 0),  // linkBcntrld - (LINK, BCNTRLD)

     hParamPong has the adress of the Param to be linked. The address comes from line 212 of teh same file:

     hParamPong = CSL_edma3GetParamHandle(hChannel,1,NULL);

    So uless you were copletely sure (and I do not think you can be sure) that the value returned by the function is 0x4820 (that corresponds to Param 65), you can not change it. The haldle can be poining to another Param.

    Pete said:

    What is the role of BCNTRLD? I couldn't understand what was written in spru966b

    "The count value used to reload BCNT when BCNT decrements to 0 (TR is submitted for the last array in 2nd dimension). Only relevant in A-synchronized transfers."

    For information on A-synchronized transfers, please see pages 26/27/28 of the EDMA3 user's guide.

     

  • what documents talk about the CPU interrupt? I went over this document

    http://focus.ti.com/lit/ug/spru871j/spru871j.pdf

    but still don't understand these 2 commands:

     /* Clear CPU interrupt event 72 (EVTCLR2) */
        *((Uint32*)0x1800048) = 0x00000100;

        /* Enable CPU interrupt event 72 (EVTMASK2) */
        *((Uint32*)0x1800088) = 0x00000100;

  • Please see datasheet pages 89 (0x1800048 is the address of the event clear register 2 and 0x1800088 is the address of the Event Mask Register 2), 122 (event 72 is the EDMA3CC completion interrupt - Mask1):

    http://www.ti.com/lit/gpn/tms320c6455

    Please find more information about this registers at the document:

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru871j

  • The question is why does the example use EVTCLR2 and EVTMASK2 instead of EVTCLR1 and EVTMASK1?

  • Because event 72 (EM72 and EC72) belongs to the EVTMASK2 and EVTCLR2 registers, see pages 176 and 178.

  • Thank you very much. I guess I'm pretty clear now.

  • After review the code, I still have another question:

    The function edmaHwi() calls copyData() once, then processBuffer() calls copyData() once more. Is it redundant?

     

  • Totally redundant, you are correct. So just go to your edmaHwi()  function and comment the copyData lines:

      if (pingOrPong == PING)
      {

             pingOrPong = PONG;
    //         copyData(gBufferRcvPing, gBufferXmtPing, BUFFSIZE);
       SWI_or(&processBufferSwi, PING);
      } else
      {

          pingOrPong = PING;
    //      copyData(gBufferRcvPong, gBufferXmtPong, BUFFSIZE);
       SWI_or(&processBufferSwi, PONG);
      }

    It will work like that.

  • Thank Mariana. I have another issue with this application.

    I have some .wav files on my desktop. What I want is

    - DSP process sound from Line-in (which actually a .wav file)

    - After processing, DSP sends data back to my desktop then the data will be saved as another .wav file.

    How can I send the data from DSP board to my desktop?

  • Pete,

    You can use fopen/ fread/ fwrite/ fclose and read/write to the files you want from your computer.

    Also, CCS has a File I/O option that will allow you to stream data to a file on your PC. You can use this to stream data while continuously running a program. More information about this feature is available by navigating within CCS to Help -> Contents -> Debugging Windows and Analysis Tool -> The Debugging Process -> File Input/Output -> Streaming Data To/From a File.

  • As I'm doing the filtering, I realize that even if I don't play any sound, the DSP board still receives some signals from line-in. In other words, the values of gBufferRcvPing and gBufferRcvPong are not 0 in all cases.

    I'm not sure this is the reason that causes "eeeeeeeeeeee" sound when I use a band pass filter. It does not happen with original dsk_app. I think there maybe something wrong with my filter coefficients although I can hear both "eeeeeeeeeeeee" and the speech.

    Any ideas to help me out?