cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 How to start SPI DMA transfer by event

wqw.1
Associate II

I have a ADC chip connected via SPI to STM32H7x MCU. MCU is master spi, and ADC sends "Data ready" signal whenever new values are ready to transfer. I need sampling rate above 100000 samples per second。If i listen to external interrupt (Data Ok) and calls SPI transfer to read valus, the cpu is getting interrupted too many times and i can’t do anything else。

CSTART is set by software to start spi communication. Is there a way to start tranferring when external event or other event? 

wqw1_1-1688799515425.png

 

 

11 REPLIES 11

Thank you very much for your explanation.

I still have a couple of doubts, if the reading frequency and sampling frequency are inconsistent, over time it may cause the DMA to read data while the sampling is not completed. In my application, I need to adjust sampling to ensure that multiple sets of equipment are sampling in step. How to adjust SPI->DMA to ensure consistency with sampling.

 

Reading and sampling frequency are the same, synchronous. But I was mistaken that SPI alone could synthesize all required signals, erroneously thinking that CONVST and _CS could be jumped. There is t-quiet 50 nsec spacing required by AD, so it leaves dual timer (1-st option) only the way. And it 'd complicate things more than I was doing with AD7984, main Timer has to be configured in dual combine PWM to synthesize _CS and CONVST with correct phase shift. I can't do testing since I don't have such adc around, but in theory it looks quite possible /realistic.