3 Replies Latest reply on Jul 2, 2017 10:53 PM by hima

    Using USB DMA to stream ADC data

    eslatter_2357181

      I have read through all the DMA notes and USB datasheet and I am just a little confused conceptually on the best way to steam ADC data over USB. I am using the EOC on a Sequencing ADC to trigger a DMA channel from the final array of the ADC to the a ping pong buffer, and I would like to stream the data over USB. Using DMA with manual buffer management this is pretty straightforward: Each TD triggers an interrupt and the ISR sends the inactive (full) buffer to the USB using loadInEP().

         

      I was thinking it would be better to use USB DMA with automatic buffer management since it would enable the use of a larger buffer for each loadEP (it is an ISO endpoint), but since the source array changes each time I need to call load it seems like I would have to call loadEP twice? the first time sets the new source array and the second time triggers the DMA? this is more complicated than the manual DMA it seems for this kind of setup.

         

      If I set up DMA directly from the ADC results buffer (two bytes, since I am sequencing two channels at 8-bits each) to the USB ISO endpoint would it buffer them and send a full packet at once or would it just send a ton of two-byte packets?