I need to take samples from SAR ADC at constant rate of 100Ksps and resolution of 8 bits. I read the datasheet of the ADC and relevant ANs (Starting with DMA, ADC buffering using DMA, DMA advanced topics, etc...). For the samples logging I used the "Teraterm" software. Before starting the design, I wrote a small program which sends data via USB UART and saw that it rate is about 230 KBytes/sec, which enough for ADC with 100Ksps of 8 bits/sample .
I saw a lot of examples, while most of them take some amount of samples from ADC, stop sampling and send the samples via DAC or serial interface. This kind of solution isn't good for me, I need a constant sampling rate, I can't lose samples. The only similar example to my case was EP8353 ("ADC to Filter – Dual Channel 16-Bit Streaming using DMA"), but there the author didn't sent the samples via USB UART.
My idea is using 2 DMA channels, while ADC writes to the one of them, I am reading from the second and vice versa (in my previous design I did the same trick using one common array and one DMA, the result was the same.. :-( ). The data that I got wasn't as expected, it seems that there is overlaps..., and some missing writes to register (data that sent was from previous filling of the same register, please see attached picture).
The results are better (but not perfect) at sample rate of 10 Ksps than 100Ksps.
I thought about few solutions (but I assume that there is more elegant solutions...)
1. I thought about using intermediate register as described AN61102 ("ADC Data Buffering Using DMA", page 16), but I don't fully understand how this serial process can help, while I try to implement a parallel process (I try to live more time to USB UART if there will be any delay, due to flow control for example...?)
2. I afraid that the bit rate using USB UART with TeraTerm isn't constant (maybe average rate is sufficient but the momentary is not) and I need to use full USB part..?
3. Adding local memory..., too complicated.
If you can share some ideas how to implement streaming of 100Ksps, 8 bits/sample ADC's data via USB UART it will be great.