cancel
Showing results for 
Search instead for 
Did you mean: 

DC bias from MEMS microphone using ADF on STM32U5

DGran.3
Associate II

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? ​

1 ACCEPTED SOLUTION

Accepted Solutions
DGran.3
Associate II

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

View solution in original post

3 REPLIES 3
DGran.3
Associate II

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

CBeli.1
Associate II

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.

CBeli.1
Associate II

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;