I am working on a c5535 design that uses multiple AIC3204 codecs on multiple I2S ports. My signal processing is done on a 10 ms frame basis so I am using DMA to transfer the audio data to and from the I2S ports.
I’m using DMA’s that are synchronized to the I2S ports, with ping/pong transfer mode.
In order for the audio data from the multiple codecs to “line up” for the frame processing, I need all DMA “frames” to start and complete at the same time ( being “synchronized” to each other, at least within a few sample times ). In following the initialization instructions on page 18 of the “TMS320C5515/14/05/04 DSP Direct Memory Access (DMA) Controller – User’s Guide” ( Literature Number SPRUFT2A ) ( And as also documented on page 146 of SPRUH87CC ),
I first configure the codec ICs ( AIC3204 ),
configure the DMA transfers as described in instructions 1 through 11 of page 18 of the above mentioned document,
and finally perform instruction 12 from page 18 in “enabling peripheral being serviced the DMA channel” in this case the multiple I2S ports, which should start the DMA transfers relatively at the same time.
The problem is, the DMA transfers complete at random times relative to each other and do not “line up” so I can run the frame processing. For example, the DMA from the I2S0 port might occur 2, 5, or 8 ms after the DMA transfer from the I2S2 port. ( I’m using 10 ms frames ). So apparently, the individual DMA channels are not starting out in the same internal states, even though I am resetting them in the PRCR register before I start the configuration, and enabling the associated I2S ports at the same time.
In debugging this I was setting a breakpoint between when the DMA channels are configured and when the I2S ports are enabled, and “magically” when I continue the DMA the channels are aligned. So I put a delay loop between the DMA configuration and the I2S ports being enabled and when the delay is greater than 10 ms, the channels do align, with less delay they don’t and they start out in a random alignment.
So my question is, do you know why the DMA channels do NOT start out in the same state until x number of clock cycles after being configured and what is that exact number of cycles ( or delay time ) to get them to the same state? Or, is there something else I need to do that I don't see in the documentation?
Any feedback would greatly be appreciated as I don’t see any other information on this in TI’s documents or forum.
Regards,
Tom