cancel
Showing results for 
Search instead for 
Did you mean: 

My board has two I2S interfaces, but the DMA controllers are only connected to one of them. Should I use the DMA for audio in, or for audio out?

NNagy.1
Senior

I thought I had checked everything about the F767ZI Nucleo-144 and its pin availabilities. Unfortunately I overlooked that I2S_A is the only one whose peripheral pins are connected to the SPI_RX and SPI_TX regs for DMA streams.

This means that for my audio in and out project, only one of the two I2S interfaces can operate in DMA mode.

So... is there a better choice which one? I don't really know if there'd be any difference in quality between connecting the DMA channel to the audio in interface, or the audio out, or if it's irrelevant.

If it makes any difference, this is a project that will be doing a lot of sampling, looping and overlapping audio samples, while also supporting live audio in/out.

4 REPLIES 4
berendi
Principal

There are 3 SPI interfaces with I2S capability, all of then can issue DMA requests.

In addition there are 2 SAI peripherals with 2 channels each that can be persuaded to talk I2S, all of then too can issue DMA requests.

But in the case there were not all DMA streams available (used by other peripherals?), I'd use DMA for the channel requiring more bandwidth, and interrupts for the one with less bandwidth. A 200 MHz MCU would have no trouble handling data at audio sample speeds, as long as you don't use HAL functions.

Maybe I’m misunderstanding the data sheet but I don’t think one of the I2S channels is connected to the peripheral pins, and even then I don’t think the SPI regs / DMA channels are connected to the pinouts for two of the three I2S interfaces. I might double check.

Dont have any experience with SAI yet but I’ll look into it.

Yeah, I’m not a big fan of the HAL libraries. Sounds like that’s the consensus in the community anyways.

The alternate function mapping tables in the datasheet list the possible pin mappings for I2S1/I2S2/I2S3 pins. There are usually more than one possible pin mappings for each peripheral. Then the board user manual lists where those pins are available on the headers. The labels on the Nucleo board are just one possible mapping.

DMA request are connected to peripherals, not pins. Again, there can be more than one possible mappings for one peripheral. Look for the SPI1/2/3 transmit and receive requests in the DMA1/DMA2 request mapping tables in the reference manual, they will be used for I2S if the peripheral is in I2S mode.

Piranha
Chief II

For audio protocol needs, including I2S, SAI is better and should be the first choice! Use SPI only if you can't use SAI.