Skip to main content
Associate
August 2, 2023
Solved

Stoping MDF (ADF) clock output

Greetings,

I'm using a low power microphone and would like to turn it off when not in use. That is done by turning off the clock to microphone, which is generated in ADF as output clock. Stopping sample acquisition (either by TRGO using window mode acquisition mode or by calling HAL_MDF_AcqStop()) does not stop the output clock. The only way I found to stop it is to call HAL_MDF_DeInit(), but that takes multiple clock cycles. Is there a way to set output clock to only be enabled when sampling? Also, when I DeInit the MDF, the clock pin stays High. Is there a way to leave it low (just pulldown resistor doesn't work)?

This topic has been closed for replies.
Pierre_Paris
Pierre_ParisBest answer
ST Employee
August 10, 2023

Hello @btd5 ,

Thank you for your question.

The clock generator (CKGEN) block is responsible of the generation of the processing clock, and the clock provided to the MDF_CCK0 and MDF_CCK1 pins.

You can directly copy paste this line into your code.

 

/* Disable clock generator */
p_mdf_base->CKGCR &= ~(MDF_CKGCR_CKDEN);

 

Please in order to keep the MDF in a stable state follow this sequence :

  • HAL_MDF_AcqStop()
  • Disable clock
  • (Not in use)
  • Enable clock
  • HAL_MDF_AcqStart()

Best regards,

Pierre

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

1 reply

Pierre_Paris
Pierre_ParisBest answer
ST Employee
August 10, 2023

Hello @btd5 ,

Thank you for your question.

The clock generator (CKGEN) block is responsible of the generation of the processing clock, and the clock provided to the MDF_CCK0 and MDF_CCK1 pins.

You can directly copy paste this line into your code.

 

/* Disable clock generator */
p_mdf_base->CKGCR &= ~(MDF_CKGCR_CKDEN);

 

Please in order to keep the MDF in a stable state follow this sequence :

  • HAL_MDF_AcqStop()
  • Disable clock
  • (Not in use)
  • Enable clock
  • HAL_MDF_AcqStart()

Best regards,

Pierre

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.