Hello,
I have a basic question about the use of DMA that I couldn't really understand from the documentation. I am hoping someone out there could give me a quick and easy answer to my question.
Let me start by explaining what I have. It is pretty simple. I have my DMA attached to a McBSP port in SPI mode which is collecting data from an external ADC (I am running on a 28346). I have set up a buffer on my DSP which consists of 32 Uint16 words. I want to read in 16 words of data and then signal my DSP to work with those 16 words that I read in. IN the mean time, I want to continue reading 16 more words into the remaining 16 words of storage, at which time I want to signal the DSP again, and wrap the destination storage back to the start of the buffer.
So basically, I have a 32 word circular buffer that I want to continuously fill with data, interrupting the DSP every 16 words read in.
I have this all configured and "running", but it is not really clean in the way I have done it. I have my wrap configured for 32 bursts, (1 word per burst - SPI mode) with a step size of 1. I then set the transfer size to 16, gave the interrupt, and made the channel run in continuous mode so that it would continue after the first 16 words.
What I saw happen is that it would read the first 16 words, interrupt the DSP, and then start writing the next 16 words back at the starting address. After reading the documentation closer, I see that the transfer concludes the transaction, and that if run in continuous mode, it will reset the wrap counts and addresses when the transfer size is reset, restarting the transfer from scratch. As you now know, this is not want I want!
So what I have done as a work around is to set the destination address for the DMA channel within the ISR that gets called from the transfer interrupt. I manually reconfigure the destination address for the channel each time to force it to write to the location that I want it to go to. This seems kludgey and wrong to me, but I cannot figure out a better way to accomplish what I am trying to do.
Is there a better way to accomplish what I am trying to do here? Perhaps I shouldn't be using transfer size at all?
I am hoping this is an easy question for you experts out there - I appreciate any help or suggestions.
-Jeff