Skip to main content
Associate II
February 12, 2025
Solved

H5 ADC clock

  • February 12, 2025
  • 4 replies
  • 1101 views

Hi, I'm using the Cube IDE 1.17 on an H5.  The HCLK is 248MHz.  When I try to configure the ADC/DAC clock to use HCLK, I get a red error.  According to the data sheet, the maximum clock to the ADC is 75MHz.  I am configuring the clock as divide by 6.

Am I misunderstanding the maximum ADC clock rate in the datasheet?  The part should be able to perform 5 MSPS.

Regards,

Mike 

Best answer by mƎALLEm

Hello @MikeInMinnesota 

Please refer to the datasheet:

SofLit_0-1739455791646.png

At System clock of 248Mhz you are at VOS0. fADC ker clock should not exceed 125Mhz.

This is already shown by the message in CubeMx:

SofLit_1-1739455897852.png

You can use PLL2 for the ADC kernel clock to not exceed 125Mhz at VOS0:

Example of ADC ker clk = 108Mhz keeping the system clock at 248Mhz.

SofLit_2-1739456135848.png

Hope that answers your question.

 

 

4 replies

TDK
Super User
February 12, 2025

There are limits on  f_adc_ker_ck_input, which is the clock fed to the ADC before it is divided down. The limit varies by part and by run mode.

TDK_0-1739396355092.png

 

There are additional limits on f_adc_ker_ck, which is the clock after it's been divided down.

TDK_1-1739396387963.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
AScha.3
Super User
February 12, 2025

Hi,

so choose a somewhat lower clock... (that can work on AHB bus)

AScha3_0-1739396552009.png

+ the "red error" telling you, whats wrong (just go with mouse pointer at it).

If you clock it at 75M , it can reach 5 Msps / 12 bit. (with minimum sampling time)

But be aware: it needs low impedance driving the input then:

AScha3_1-1739396884381.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
February 13, 2025

Hi, thanks for all the advice.

The part is an STM32H523CC.

The ADC portion of the clock tree is:

MikeInMinnesota_0-1739453308116.png

Hovering doesn't display any error message.

The main setup for the APBs is:

MikeInMinnesota_1-1739453386928.png

That's selecting HSI, PLLM/4, N=X31, P=/2 and PLL1P to SYSCLK

The ADC itself is independent, with no injected channels.  The HCLK is divided by 6 for the ADC, and sampling is 6.5+2.5=9 clocks.  That's a little under 5 MSPS.

Would I be better off using PLL2R to bring in the ADC clock, already divided by 6?

mƎALLEm
mƎALLEmBest answer
Technical Moderator
February 13, 2025

Hello @MikeInMinnesota 

Please refer to the datasheet:

SofLit_0-1739455791646.png

At System clock of 248Mhz you are at VOS0. fADC ker clock should not exceed 125Mhz.

This is already shown by the message in CubeMx:

SofLit_1-1739455897852.png

You can use PLL2 for the ADC kernel clock to not exceed 125Mhz at VOS0:

Example of ADC ker clk = 108Mhz keeping the system clock at 248Mhz.

SofLit_2-1739456135848.png

Hope that answers your question.

 

 

"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."
Associate II
February 13, 2025

Hi, SofLit and TDK - thanks, that resolves it.

The bug in the CubeIDE is if the clock tree is reloaded then the error message of needing to be less than 125MHz does not display.  That's with version 1.17.

I guess was confused by the adc_ker_ck restriction to 125MHz and what clock was selected.  I thought by selecting HCLK in the CubeIDE then I'd get adc_hclk instead of adc_ker_ck_input.  Using adc_ker_ck_input means I should set CKMODE to 0 instead of adc_hclk/1.

Regards,

Mike