2017-02-17 03:29 AM
I want to have 60 MHz on the MCO1 pin PA8. I use an external 25 Mhz crystal. The PLL delivers 180 Mhz to the system clock. I've used STCubeMX to configure the clocks to get 180 MHz / 3 on MCO1.
Unfortunatly I'm not getting any activity on the MCO1 pin at all.
Some things I've tried:
- Checking the registers in the debugger, looks correct.
- Setting MCO1 register to 0x02 for using HSE. This works fine, I'm getting pulses on MCO1
- Setting PLL down to 75 Mhz. No activity on MCO1.
Is this some limitation or erratta that I somehow missed in the documentation?
Solved! Go to Solution.
2017-02-17 03:41 AM
Solved!
In MX_GPIO_Init() the GPIO speed setting was
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
Changed it to:
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
This can also be done in CubeMX under RCC configuration -> GPIO
Funny thing is, that the port is actually set up for VERY high speed in HAL_RCC_MCOConfig() but this is called before MX_GPIO_Init()
2017-02-17 03:41 AM
Solved!
In MX_GPIO_Init() the GPIO speed setting was
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
Changed it to:
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
This can also be done in CubeMX under RCC configuration -> GPIO
Funny thing is, that the port is actually set up for VERY high speed in HAL_RCC_MCOConfig() but this is called before MX_GPIO_Init()
2018-08-09 08:30 AM
HAL_EnableCompensationCell();
might be necessary for higher clock frequencies