2020-11-24 01:06 AM
Dear experts,
I am using STM32H750 vbt6 in my project .
Recently I decided to use MCO1 to produce clocks for other devices attached to this chip .
Also, I am using STM32cube IDE for working .
It seems that setting the right parameters for MCO1 to work properly, is an easy task
(by using CubeMX).
(The input of source multiplexer of MCO1 is: HSE or PLL1Q and the output frequency of this MCO1 pin will be between 28MHz to 35 MHz.)
Here are my questions:
1-Are there any HW or SW recommendations for me to make this MCO pin work properly?
2-Does this pin produce "square wave form clock pulses"?
Your consideration is highly appreciated.
Regards,
HT.
Solved! Go to Solution.
2020-11-24 03:08 AM
/*Configure GPIO pin : PA8 */
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF0_MCO;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
to e.g. analog:
/*Configure GPIO pin : PA8 */
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Good luck!
/Peter
2020-11-24 01:28 AM
You have likely already enabled MCO1 in the RCC block of STM32CubeMX, which makes the GPIO act as MCO1. This GPIO is per default set to Alternate Function Push Pull, but also to Max Output Speed = Low.
To change this you should open the block GPIO, select that GPIO (PA8 for the STM32H750VB) and set the Max Output Speed = High or Very High.
And yes, this pin produces a "square wave" signal.
When your question is answered, please close this topic by choosing Select as Best.
Good luck!
/Peter
2020-11-24 02:11 AM
Hi Peter,
Thank you so much for reply.
I already did what you suggested me .
1-Is there any HW consideration (constraint) for using this pin?(using capacitors, resistors, or considering length of tracks for this pin and so on).
(Right now, I am testing on an evaluation board with RG174 cable for this pin and I haven't designed the proper PCB for this pin and my project yet.)
2-Can we turn on/off the output clock of this pin by SW somehow in the run-time ?
(If not, by using and AND gate?)
Your consideration is highly appreciated.
Regards,
HT.
2020-11-24 03:08 AM
/*Configure GPIO pin : PA8 */
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF0_MCO;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
to e.g. analog:
/*Configure GPIO pin : PA8 */
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Good luck!
/Peter
2020-11-24 05:52 AM
Hi Peter,
Thank you so much for your answers. If I face any problem, I will ask it asap .
Regards,
HT.