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.

EMDA3 for a T1/E1 Framer

I need some help in understanding the EDMA setup so that I can program a C6424 to DMA the bytes on a T1 frame (basically 24 channels of mu-law PCM) into arrays of 80 samples each, per channel, for purposes of voice encoding.

The T1 data arrives in EMIF memory every 125 us. as 24 consecutive bytes corresponding to single samples for channels 0..23.  There is an interrupt when the data is available.  I need to basically de-interleave the data and arrange into arrays of 80 samples each for all channels and then generate a single interrupt to the CPU.  The idea is to have the DMA controller handle moving data and not get interrupted until the entire block of 10 ms. of audio is available.

I am confused about ACNT, BCNT, etc.  Not sure if ACNT = 80 or ACNT = 24 in this case, and same for BCNT.  Also would be helpful to understand the various xxxIDX register setup.


Thanks

  • Hi,

    Thanks for your post.

    In general, the C6424 EVM does not have a specific CSL (Chip Support Library); instead it has a PSP (Platform Support Package) that provides drivers for the peripherals in addition to a register layer CSL. You could download the BIOS PSP release version 1.10.03 for c6424 EVM from the below:

    http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/psp/bios_psp/index.html

    The above PSP package contains DSP/BIOS drivers and CSL (register layer) for C6424 SoC's

    You could also check the c6424 release notes for any known issues and you would find all the peripheral drivers datasheets too. Please download EDMA LLD 1.01 for C6424 platform from the below:

    http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/psp/edma3_lld/index.html

    Also, you have to check your device-specific EDMA User's Guide for information on this peripheral at the hardware level. For programming examples you can refer to an article below:

    http://processors.wiki.ti.com/index.php/Programming_the_EDMA3_using_the_Low-Level_Driver_(LLD)#EDMA3_LLD_Download_.2F_Contributed_Examples

    From the above wiki, you could download the EDMA LLD examples (tto_lld_6437.zip) and Workshop chapters (EDMA3_LLD.pdf) in which, please check for audio example project which uses the DMA to transfer data in a simple audio application and this example includes synchronization, linking, and sorting as you see this example in the below path after installation:

    ~\ti\C6437_EDMA_LLD_examples\tto_lld_6437\tto_lld_6437\lld_example7_audio_6437

    Note: c6437 audio example would be compatible to c6424, you could use this examples to modify it for c6424 SoC level changes.You can access the code examples at TI's external Gforge site.

    and for a register-level programming example you can refer to programming EDMA with out EDMA3 LLD package as below:

    http://processors.wiki.ti.com/index.php/Programming_EDMA_without_EDMA3LLD_package

    Also, please check the below E2E post for your reference:

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/p/51892/185533.aspx#185533

    Thanks & regards,

    Sivaraj K

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

    Please click the Verify Answer button on this post if it answers your question

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

     

     

     

     

  • Jeff,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages. Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics.

    There have been other discussions about techniques for using EDMA3, so a search of the forum should find you some good material to help understand the use of the different terms. (Be sure to spell it right in your search; I noticed the title had a couple letters transposed, which I think you can fix with the Edit pencil icon on your original post above.)

    You can also search TI.com for EDMA3 training material. I know there are some out there; I did a video for EDMA3 a couple of years ago, but it seems to keep moving around from where I thought it was. And the IW6000 training on the Wiki has a module about using and programming the EDMA3. All of these materials will do a much better job than us trying to rewrite what has already been recorded and written.

    90% of what I know about the EDMA3 came from the EDMA3 User's Guide. I wanted to learn how to use it, so I read the UG cover to cover, and had to re-read some sections to understand it. If you do that, and have some questions about a particular line that does make sense to you, please ask. But "I do not understand ACNT and BCNT" tells me you need to go through the UG and the training materials I mentioned. If you cannot find the UG or the training materials, tell me what exact search you tried and I will help you clarify it.

    Regards,
    RandyP

  • All,

    Thanks for the responses.  This is helpful - http://processors.wiki.ti.com/images/5/5e/EDMA3_LLD.pdf.  After reading this, I think that I could program a single frame transfer of 24 PCM samples (16 bits each) to it's appropriate destination location.

    What I really want to accomplish is moving 24 channels of PCM samples into buffers of 80 samples each and then have a single interrupt from the DMA controller to signal completion.

    The data arrives every 125 microseconds in EMIF memory in a consecutive block of 24 x 16 bit words - in "C" this storage would look like "int16 pcmInReg[24]".  The destination storage could be declared as "int16 pcmRxBuf[24][80]";  (where int16 = 16 bit integer type). There is a GPIO interrupt signaling availability of the receive data.

    Upon receiving the 1st interrupt pcmInReg[0] is copied to pcmRxBuf[0][0], pcmInReg[1] is copied to pcmRxBuf[1][0], etc...  Upon receiving the 2nd interrupt pcmInReg[0] goes to pcmRxBuf[0][1], and so forth - then a single DMA complete interrupt occurs after 80x24 such transfers are complete.

    I know that the above example would require 2 sets of destination buffers because one is filled when the other is processed, so there is really another "int16 pcmRxBuf2[24][80]" which would be used for the 2nd block (24x80) of samples.

    For a single transfer of 24 x 16 bit words, I would set ACNT=2 (2 bytes=16 bits per sample), BCNT=48 (2 bytesx24), SRCBIDX=2, DSTBIDX=160 (# of bytes between pcmRxBuf[0][0] and pcmRxBuf[1][0]), CCNT=1.  Is this right?

    The larger task is a bit different from every example that I have seen because the source data is always coming from the same array of 24 x 16 bit words.  What is not clear to me is how to expand the single 24x16 transfer to autonomously do this 80 times, keep the pointers correct and not have to service interrupts every 125 us such that:

    (1) I transfer only 24 x 16 words per GPIO interrupt, then wait for next GPIO interrupt - in other words synchronize the availability of the data

    (2) wrap the source/dest pointers to the appropriate locations (not sure if A or AB sync)

    Any input appreciated - thanks

  • Jeff,

    The EDMA3 training material, and to some extent the User Guide, walk you through these operations. That is much superior to me trying to do that.

    Take diagrams like the figures in the User Guide and ask yourself how well they fit what you are trying to do. For example, Figure 2-5 A-Sync shows a bunch of data arrays (elements) being transferred. There is a event vertical arrow showing how much will be transferred each time an event is received. Is this what you want each time you get the GPIO event? Then look at Figure 2-6 AB-Sync and look at the data transferred after each event vertical arrow to see how much is transferred each time. Is this what you want each time you get the GPIO event. If either is what you want, then that is the sync mode you want to use. Try it, test it, prove to yourself that you made the right choice.

    Jeff Tsao said:
    For a single transfer of 24 x 16 bit words, I would set ACNT=2 (2 bytes=16 bits per sample), BCNT=48 (2 bytesx24), SRCBIDX=2, DSTBIDX=160 (# of bytes between pcmRxBuf[0][0] and pcmRxBuf[1][0]), CCNT=1.  Is this right?

    No. Why did you set BCNT to 2 bytes x 24? Look at the data sorting example in the User Guide. Concentrate on the text descriptions for the values for the various fields. The values they show in Figure 3-6 has at least 1 error. If you find it, you will have graduated from EDMA3 training.

    And if you understand how this example works, you should understand how to do your application.

    Regards,
    RandyP