cancel
Showing results for 
Search instead for 
Did you mean: 

SAI for 8 channel TDM?

SKarl.3
Associate II

Hello,

I'm spec'ing a system where we would need to interface 4x eight-channel ADCs with an MCU for audio capture. Simultaneous capture on all channels is an important requirement.

Currently we are considering the STM32H750VB MCU which has 4x SAI interfaces, and the Analog Devices AD7768. All ADCs would be running at the same time, synchronized, and the data from them would be DMAed into ring buffers.

I'm not familiar with the ST SAI interface. It seems like they can support 8 channels in TDM mode (which that ADC supports), but I'm not sure?

Can this be done with the STM32H750VB?

6 REPLIES 6

@SKarl.3 wrote:

I'm not familiar with the ST SAI interface. ?


Neither am I, but does this help: https://www.st.com/resource/en/product_training/STM32F7_Peripheral_SAI.pdf ?

LCE
Principal

I know the H723 / H735 SAI a little bit better now - at least for normal "stereo" ADCs / DACs / SPDIF TX, but I have not used TDM.

There is the SAI's SLOTR register where you can set up to 16 "slots" per SAI block and enable each slot individually, so at first glance it looks feasible.

Check also the reference manual! This uses "TDM" mostly in regard to PDM microphones.

Depending on the sampling rate, I wonder how you will cope with these amounts of data?
At fs = 50 kHz, that would be ~1.6 Msamples/s, which should not be a problem for the DMA / internal RAM (check if that particular H7 supports HyperRAM via its OCTOSPI, some are kinda whacky), but I guess DSP stuff will be too much.

Thanks. I saw that and it does look like it is possible. Just looking for more verification.

The application is beam forming, and I'm hoping to sample at up to 192kHz if possible, for maximum time resolution. Data would just get dumped into ring buffers. Any DSP would be done on a few highly decimated streams. I know this is getting into territory that might be more suitable for a small FPGA, but I'd like to stick with an MCU if possible.

 

AScha.3
Chief III

Hi,

>Can this be done with the STM32H750VB?

Maybe...

1. i would not choose the cheapest H7 , better STM32H723 or H733 (i use H743ZIT or H753ZIT ).

-> H723 : about 500K ram, 1M flash, at 550MHz; H750 with only 128K flash -> only small program or external spi-flash (some extra game to play.)

2. check (just in Cube) that you can use all pins you want/need, maybe need more pins. just check before buy.

3. "TDM" is not same for AD and STM ... (TDM on STM is for the digital mics);

your ADC has data like this (from ds):

 

AScha3_0-1726770324589.png

This is not I2S, which is "standard" for audio and also on SAI works fine; you need to select "free" PCM format,

but on this you only could choose 32bit/ch , to get this special format in the SAI slots; maybe like this:

AScha3_1-1726771415096.png

-> for mode 11 on ADC, all 8ch on one data line.

(But i am not sure, this setting is working - i never tried something "strange" like this , so you have to test it yourself. And i will not work on first try - except your very lucky. )

e.g. "frame synchro" lo or hi here the right one - i dont know. (read manuals...or just try...)

 

If you feel a post has answered your question, please click "Accept as Solution".
LCE
Principal

Do NOT use the H723 .. H735:

these have "only" 2 SAIs (with 2 blocks each -> 4 stereo ADCs without TDM),
but the biggest restriction is that SAI 4 is in "domain 3" and can only be accesses via the slightly different BDMA (not DMA1 / 2), which again cannot access external RAM - which you will surely need at 25 Mbyte / s.

How do you want to transmit data?

PS: I'm running 8 ADC channels 32bit / 200kHz (only 6.4 Mbyte/s) with H723 .. H735 and OCTOSPI / HyperRAM (100MHz DDR),  Ethernet (self-made driver + lwIP), no RTOS, using as much DMA as possible.
CPU at 400 MHz is idle about 50% of the time.

In hindsight, I would have been faster with development with an FPGA - mainly due to more experience with FPGAs than with STM32 - and some problems / bad surprises on the STM32 side (SAI 4 / DMA no HyperRam access).

This was super informative. Thanks so much!