cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a 20 MHz clock with the GPIO outputs in STM320H745zi

ABlum.2
Associate III

Hello everyone!

Is there any project to generate an Clock output of 20Mhz? I tried with TIM 16 but the best I can get is around 300 kHz

Thanks in advance

Alan Blumenstein

1 ACCEPTED SOLUTION

Accepted Solutions

@ABlum.2​ That pin has the DFSDM1_CKOUT option.0693W00000BaXMaQAN.pngI never used this peripheral but its meant for driving external ADCs so the DFSDM1_CKOUT pin can generate a very fast pwm clock signal for you.

0693W00000BaXNiQAN.png 

Did you tried this already?

we dont need to firmware by ourselves, lets talk

View solution in original post

10 REPLIES 10
Mike_ST
ST Employee

In the STM32H7 firmware package,

available here:

https://www.st.com/en/embedded-software/stm32cubeh7.html

you have a PWM example \Projects\NUCLEO-H745ZI-Q\Examples\TIM\TIM_PWMOutput

and then it's a matter of adjusting uhPrescalerValue, PERIOD_VALUE and PULSEx_VALUE

Javier1
Principal

Are you using a XTAL as a HSEclock source?

How high is your system clock?

Maybe share a snap of your cubeMX page clock setup

we dont need to firmware by ourselves, lets talk

0693W00000BaVWsQAN.pngHi Javier,

Thanks for the answer here I send you a picture of the clock setup.

Hi Mike_ST

Thanks for the response. I tried to play with this example before and I am not reaching the 20 MHz, I also tried to use an interruption were I set a digital output to generate the clock but the frequency drop down to 400 kHz.

Regards

Alan

Sounds like you're trying to service an update interrupt rather than let the TIM control the pin directly. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Tesla Delorean

Thanks for the answer. Yes the pin I need to control is not realted to any TIM (pin PC2_C) hence I need to toggled it to make the clock.

Regards

Alan

@ABlum.2​ That pin has the DFSDM1_CKOUT option.0693W00000BaXMaQAN.pngI never used this peripheral but its meant for driving external ADCs so the DFSDM1_CKOUT pin can generate a very fast pwm clock signal for you.

0693W00000BaXNiQAN.png 

Did you tried this already?

we dont need to firmware by ourselves, lets talk

@Javier Muñoz​ thanks for the information, I will try this, where can I find this configuration from the image with the filters?

Regards

Alan Blumenstein

@ABlum.2​ Are you reffering to cubeMX?

The configuration appears under DFSDM peripheral config tab

we dont need to firmware by ourselves, lets talk