Skip to main content
PCu1
Senior
February 26, 2025
Question

I2S microphone and sampling frequency in CubeMX

  • February 26, 2025
  • 0 replies
  • 446 views

Hello,

Configuring the I2S on CubeMX on STM32G431, for which I've connected a microphone in PDM, I want a sampling frequency of 48KHz@16bit.


Typically, this requires a PDM frequency of 3.072MHz and a decimation of 64.
I wonder why I need to tell CubeMX the sampling frequency, since the decimation factor is configured externally to CubeMX (in PDMTOPCM lib).

To have a PDM clock  of 3.072MHz, I actually have to select a value of 192KHz for "selected audio frequency" in CubeMX, and not 48KHz.

I'm a bit confused...