2025-06-18 10:12 PM
Hi, I'm using STM32G47 MCU. I'm facing problem in my system, where I have to read data from two SPI_ADC's, one after one. Both are connected in a same SPI bus, with each have separate CS pin connected to MCU. The problem is that, I want to do everything using only by DMA. No cpu intervention or no isr should be used. The steps to be done are,
1. make CS1 low, CS2 high.
2. Start reading ADC1 ic, using spi_dma.
3. once the read completed, make the CS1 high, and CS2 low.
4. Now start reading the ADC2 ic. and repeat the process.
Here the above steps should happen continuously without any software processing. The data has to be updated in the background in the buffer. The dma has to be chained in such a way that, it happens in a sequence above. I have checked some posts, they suggesting to do using timers, but i don't think it's reliable. So, kindly provide me the best suitable solution available. Thanks in advance.
2025-06-19 2:45 AM
Hello @Karthick008
The best solution is to use timer.
@Karthick008 wrote:
. I have checked some posts, they suggesting to do using timers, but i don't think it's reliable.
Why it is not reliable ?
2025-06-19 3:03 AM
Yes thanks, but in my case, I want to avoid the timer based triggering of SPI tx. Since, the two ADC ic will send data with different delay, so I want to chain the DMA , based on the completion of one after the another. Also, can you provide how to configure them so that I can use it timer based triggering. Thanks.
2025-06-19 3:10 AM
Hello @Karthick008
You can refer to the example below as starting point.