Skip to main content
Associate
March 30, 2025
Solved

How to properly set up STM32H7 I2S as master to interface with an audio CODEC?

  • March 30, 2025
  • 4 replies
  • 2752 views

Hello! This is my first post here. I'm currently designing a DIY loop pedal for guitar, which basically records samples of audio and plays them in loop.

I'll be using a STM32H743VIT6, embedded on a WeActStudio dev board. The audio CODEC is the PCM3060. I'm aiming for 24bits resolution with 44.1kHz sample rate, 256Fs.

I don't know much about I2S in general, so this is what I've pictured: I should setup the ST as master full-duplex, so it can receive from the CODEC and transmit to the CODEC at the same time (the looped audio, when it has finished recording). 

This is what I've setup so far on CubeIDE:

gabrielgcma_0-1743348467130.pnggabrielgcma_1-1743348540962.png

(both DMA requests' data width are set to Word)

What's confusing me is the "Error between Selected and Real". Will it cause significant distortion/noise? I tried looking at the clock tree for some kind of configuration, but I didn't find something like a PLLI2SCLK (which I've found on a STM32F411).

 

This topic has been closed for replies.
Best answer by mƎALLEm

Hello,

I'm not expert of audio subject but doing a little simulation on CubeMx, I can find 0,26% error instead of 1.45% using HSI:

 

mALLEm_1-1743692699066.png

 

4 replies

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
April 3, 2025

Hello,

I'm not expert of audio subject but doing a little simulation on CubeMx, I can find 0,26% error instead of 1.45% using HSI:

 

mALLEm_1-1743692699066.png

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate
April 3, 2025

Thanks! I'll give it a try. But why 192MHz? I was thinking of using 256Fs clock frequency, and at 44.1kHz that would be 256 * 44100 = 11.2896MHz. 

mƎALLEm
ST Technical Moderator
April 3, 2025

As I said it was a simulation and got better result than you. You can try and find other settings better then me..

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.