2024-03-21 11:55 AM
Hello, I'm using a stm32F103 to read 10 channel from the ADC in continuos mode. The ADC clock is 12Mhz and the sampling time is 28.5 cycles for all channels. the convertion time for one channel is ((28.5+12.5)/12Mhz) = 3.41 us. Since i'm using adc in continuos mode, after this 3,41us the next channel will be read and this read will take another 3.41 us and the same thing for the next eight channels. So in 34.1 us each channel has one sample. So each channel in one second are reading (1000000/34,1) = 29325 samples. I just want to a confirmation for this calculations if possible, Thanks!
2024-03-21 12:09 PM
How is the data being saved? Allow for that overhead.
2024-03-25 07:42 AM
I'm using DMA to send the data to a buffer.
2024-03-25 11:30 AM
What happens when the buffer is full?
2024-03-26 08:23 AM
when the adc finishes the convertion the dma send this data to this buffer, when the adc finishes the next conversion the dma will overwrite the data in the buffer with this new data.
2024-03-26 02:07 PM
You haven't described any logic to read the buffer before the data gets overwritten.
I believe there is a DMA buffer half full flag that can be sensed. When that happens read and save the first 5 values while the conversions continue. When the DMA buffer count = 0, read and save the last 5 values. If that can't be done fast enough, the conversion sequence needs to be paused until the values are saved. That is overhead.