Intro:
I have a system using McASP in TDM mode (8 slots), and 4 serializers each in and out. So a total of 32 channels in and 32 out. I'll use input as an example in the following.
Now I want to get each channel into its own buffer. My initial attempt has only got the data from each serializer into its own buffer, which then has to be reordered by the CPU: When multiple serializers are active, the EDMA must be programmed in Frame synchronized mode. Each frame transfers the one sample from each serializer. I.e. 4. So each single sample can be placed in its own buffer.
But there is only one counter + index left (the framecount). So there is no way to have a different increment for the 'within TDM frame' i.e. different channels and 'between TDM frames' i.e. the next samples of the channels. The framecount = TDM_slots * single_channel_buffersize
When only a single serializer is active, element sync transfer can be used. So the element count/idx can be used for TDM slots, while the frame count is the single channel buffer size -1.
Untested idea
New idea for multi-serializer TDM EDMA
- Set up EDMA Params A to transfer a single TDM frame (32 samples), from McASP into the first element of 32 buffers. Link params to itself.
- Set up another EDMA Params B to be chain triggered by A. Transfer B updates A's DST to be the second element of the buffers (e.g. by copying from an array of precomputed addresses). and so on for N=buffer length. I think of B as providing a third dimension to the indexing. B's transfer complete interrupt indicates buffer full.
- I think ping pong buffering can be acheived by having 2 param sets for B, covering half the buffer each.
Questions
Before I launch into coding this monstrosity I have a couple of questions. I realise the description is pretty dense - I'm ready to expand on it if there is anyone listening...
- Is this workable to have the chained transfer update the parameter set that triggers it? Is there a race between A reloading itself, and B updating A's DST pointer? (Maybe a race can be avoided by having 2 sets of cross-linked params for A)
- Is there any other clever way of deinterleaving the multi-serializer TDM using EDMA alone?
- Does EDMA3 on newer processors work any better in this scenario?
thanks
--
Eliot