2024-08-21 03:02 AM - edited 2024-08-21 06:15 AM
Hi all, I have already searched on the forms and in general did not find an answer to my problem, I will be very grateful to you for help.
I need to create an output signal with a frequency of 100 Mhz as CLK in STM32H745. I used the Discovery Boards (STM32H745I-DISCO STM32H750B-DK) for the test.
1. I used timers with PWM and adjusted the ABM timer clock for 220 MHz, set up pre-scaler and counter period
But I achieve only 50 Mhz a clock as a maximum, with settings for 100 Mhz there is nothing at the output for CLK. To detect the clock I use PicOscope6404D (Bandwidth 500 Mhz).
2. I used as output ch A8 and adjusted A8 for RCC_MCO_1
I used the next settings but received the same result as for Timers not more than 50 MHz. Can you explain why I have this limitation (because the device settings show me that I can reach 100 Mhz but in real not )?
3. Finally I used the PA8 HRTIM_CHB2 timer and received high and very unstable frequency with very low amplitude. Do you how I can make a stable frequency and increase amplitude from HRTIM_CHB2?
2024-08-22 06:23 AM - edited 2024-08-22 06:23 AM
@Ronil wrote:
Probably I solved the problem! thank you all!
You need to tell how you solved the issue and if one of the comments above answered your question, please mark it as Accept as solution.
2024-08-22 06:37 AM - edited 2024-08-22 06:38 AM
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
replace to
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_PLL1QCLK, RCC_MCODIV_5);
but timers still don't work for 100 Mhz
2024-08-22 07:02 AM
I seen this a few times, when OP could set his own responce as "solution".
Quite illogical to me, do Moderators of the forum aware?
2024-08-22 07:04 AM
but what a problem is here? I can remove that as and question if you care about that, it was my my first question in STM
2024-08-22 07:16 AM - edited 2024-08-22 07:17 AM
Problem with statistic, in another thread OP post a question and provide responce in second post, than mark as solution. There was no other participants, so he can drive his rating up.
In this thread it make more sence to mark other person responce as a solution even its not correct answer but just lead you to think in "right direction".
In general, I think its reasonably to block OP in selection own resonce as solution
2024-08-22 07:24 AM
I guess it's worth it, I'm surprised there's a rating here
2024-08-22 08:09 AM
If someone provided the critical advice, or just gave you a serious nudge in the right direction, the polite thing is to thank them by accepting their answer. It's fine to accept your own solution if you found it on your own.
It's not just the bandwidth of your scope that determines the measurement bandwidth, but also the bandwidth of your probes. Good quality 10x passive probes should handle a 100Mhz sine wave.
2024-08-23 02:19 AM - edited 2024-08-23 03:07 AM
I only wonder why my amplitude is only 1 V, can I control the value of the amplitude of the signal?
I used and another scale but result the same
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
from RCC_MCO_1? ?
2024-08-23 06:03 AM - edited 2024-08-23 06:41 PM
Voltage scaling is unrelated to the amplitude of the crystal oscillator's output signal.
It's normal for the clock oscillator circuit itself (i.e. the chip's XTAL pins) to stabilize at this kind of amplitude. I'm not sure if the MCO output is supposed to be a buffered copy of the signal at the XTAL pins or a proper digital signal (but I note that the scope shows it looks like an analog sine wave). I'm not aware of any way to control the oscillator circuit's steady-state amplitude (It's the combined result of design choices by ST and the crystal used).
If you need a logic signal, you can try PWM with the GPIO pin set to a higher speed.
2024-08-23 06:30 AM - edited 2024-08-23 06:34 AM
Thank you
Do you mean to use PWM without a timer directly via GPIO?
Because PWM with Timer can create about 20 Mhz, but cant 100 Mhz