cancel
Showing results for 
Search instead for 
Did you mean: 

Stoping MDF (ADF) clock output

btd5
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Pierre_Paris
ST Employee

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.

View solution in original post

1 REPLY 1
Pierre_Paris
ST Employee

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.