cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use the SAI block to trigger ADC on STM32H7?

markm
Associate II

I am using the STM32H743 on STM32H743I-EVAL board.

Is it possible to synchronize ADC acquisitions with the SAI block? The goal here is to acquire audio ADC samples using DMA, block process, and transmit out to a DAC over SAI using DMA. The STM32 is the master generating SAI clocks. In order to keep system synced I need to acquire ADC samples at the same frequency as the SAI frame sync clock.

From the reference manual, there are a few output signals from the SAI block that would be ideal candidates, "sai_sync_out_sck" or "sai_sync_out_fs". Is it possible to trigger the ADC, or trigger a timer which in turn triggers ADC, with these internal signals?

Alternatively, is it possible to use a timer as the clock source to the SAI block?

4 REPLIES 4

I don't use the 'H7, but from the Interconnect chapter it appears that the SAIx_FS_A/B signals are connected to ETR inputs of timers.

JW

Thank you for bringing this to my attention JW. I will implement this and see how it works. The trade-off with this approach is that the timer has a clocked ERT input and is therefore asynchronous to the SAI FS signal. This will introduce ADC sampling jitter.

I suppose I could run the entire system at PLL settings that are audio sample rate friendly. I don't want to do this because I will not be running at max speed of 400MHz, which is the primary reason I'm using the part.

I'd say there will always be some synchronizers in the way; I believe that not only in the timer, but there may be some at the ADC's front-end, too.

Unfortunately, ST is not famous for providing excessive data on these minor but important design details.

You may want to have a look at the LPTIMs, too; they ought to be asynchronous (to some extent).

JW

SeyyedMohammad
Senior III

Yes i've done this using lptim. connect lptim to sai . then connect adc to lptim. this is possible in cube visually.