Skip to main content
Explorer
January 8, 2025
Question

SAI configuration for 2 PDM Microphone in Stereo Mode

  • January 8, 2025
  • 1 reply
  • 479 views

Dear ST Community Member,

 

I hope you are all doing well.

 

We are currently acquiring audio using the STM32G4 and 2 PDM microphones in stereo mode. I would like to know how to split the left and right channel data. Could you please provide me with the appropriate SAI settings? Thank you!

 

Best regards,  

Neeraj

    This topic has been closed for replies.

    1 reply

    ST Employee
    February 27, 2025

    Hi,

    One channel data is acquired on the rising edge of the clock, the other channel is acquired on the falling edge.

    There is an input signal on microphones, usually set to ground or vdd, to tell if the microphone sends data on the rising edge of the clock or the falling edge.

    There are more information about this topic in the series of video there: https://www.youtube.com/watch?v=_YQSJJQUp-g

    best regards,

    Emmanuel

    Visitor II
    March 1, 2025

    In stereo mode you would get an interleaved buffer: left PDM word followed by a right PDM word.
    Even after converting PDM into PCM - still an interleaved buffer (like for I2S).

    If you want to split the "stereo buffer" into two separate single channel buffers - you have to split by SW, e.g. via C-code running over the buffer or using a Mem-to-Mem DMA (as a "vector DMA": skipping the other channel values).