Skip to main content
Visitor II
May 19, 2022
Solved

DC bias from MEMS microphone using ADF on STM32U5

  • May 19, 2022
  • 3 replies
  • 2485 views

I have a MEMS microphone (IM72D128V01, using this eval kit) with PDM output connected to a STM32U5 NUCLEO board.

It's connected to the ADF/Audo Digital Filter peripheral which I have configured to provide a 5th order CIC filter with a 32x decimation factor. ADF clocking is configured to output a 3,072,000Hz data clock to the MEMS sensor.

Every time I start my STM32 program I have to physically power cycle the MEMS IC or else I get a DC bias in the data register - the most significant byte of the 24bits in the data register (which includes the sign bit) is constantly 0x0 meaning the integer sample values are all positive.

As soon as I power cycle the MEMS IC I immediately start getting a mix of positive and negative integer sample values as I would expect. This persists until I terminate and relaunch in CubeIDE.

How do I diagnose/resolve this? ​

    This topic has been closed for replies.
    Best answer by DGran.3

    Turned out the issue was on the ​sensor side, the LR pin was accidentally floating and this controls dc bias

    3 replies

    DGran.3AuthorAnswer
    Visitor II
    May 27, 2022

    Turned out the issue was on the ​sensor side, the LR pin was accidentally floating and this controls dc bias

    Visitor II
    April 6, 2023

    Hi, I have the same MEMS sensor and an Nucleo-U575

    I am trying to turn on a light when the sensor hears something using the SAD.

    My configuration is as follows:

    I have as ADF input clock: MSIK@12MHz

    Then a Output clock divider set to 4. So my output clock would be 3MHz.


    _legacyfs_online_stmicro_images_0693W00000bhgsJQAQ.pngpins are:

    PE9: ADF_CCK0

    PE10: ADF_SDI0

    This is the LPDMA section(copied from the ADF_AudioSoundDetection example):
    _legacyfs_online_stmicro_images_0693W00000bhgtvQAA.pngAnd this is my callback function

    void HAL_MDF_SadCallback(MDF_HandleTypeDef *hmdf)

    {

     HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin);

    }

    Unfortunately nothing happens.

    Visitor II
    April 6, 2023

    My problem is that I keep hitting this error

    /* Check if saturation occurs */

     else if ((interrupts & MDF_DFLTISR_SATF) == MDF_DFLTISR_SATF)

     {

      /* Clear saturation flag */

      hmdf->Instance->DFLTISR |= MDF_DFLTISR_SATF;

      /* Update error code */

      hmdf->ErrorCode |= MDF_ERROR_SATURATION;