cancel
Showing results for 
Search instead for 
Did you mean: 

The clock provided to the MCOs outputs must not exceed the maximum pin speed

Tkuma.1
Associate II

hi community,

I am currently using the STM32H743ZI board,in the reference manual it is written like this

"The clock provided to the MCOs outputs must not exceed the maximum pin speed (refer to the product datasheet for information on the supported pin speed)".

This information i am not able to find in the data sheet.

please help me to find out this information.

Best Regards,

Velpula Tharun Kumar

2 REPLIES 2

There's OSPEEDR settings for the pin that affect it's slew rate, there's also compensation settings, and impact with respect to supply voltage ranges

Between the Data Sheet and Reference Manual you should be able to narrow it down.

Suffice to say you aren't going to be able to push 400 MHz out of the pins, and you should probably stay well below 100 MHz

 gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;// << Goes into OSPEEDR

 /*

 Note : The activation of the I/O Compensation Cell is recommended with communication interfaces

     (GPIO, SPI, FMC, QSPI ...) when operating at high frequencies(please refer to product datasheet)

     The I/O Compensation Cell activation procedure requires :

    - The activation of the CSI clock

    - The activation of the SYSCFG clock

    - Enabling the I/O Compensation Cell : setting bit[0] of register SYSCFG_CCCSR

 */

 /*activate CSI clock mandatory for I/O Compensation Cell*/

 __HAL_RCC_CSI_ENABLE() ;

 /* Enable SYSCFG clock mandatory for I/O Compensation Cell */

 __HAL_RCC_SYSCFG_CLK_ENABLE() ;

 /* Enables the I/O Compensation Cell */

 HAL_EnableCompensationCell();

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

Divide down the clock so it comes out at a manageable rate. ie doesn't consume a lot of current, cause ringing on your board, and is measurable with your scope.

STM32Cube_FW_H7_V1.8.0\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_rcc.c

/**
  * @brief  Selects the clock source to output on MCO1 pin(PA8) or on MCO2 pin(PC9).
  * @note   PA8/PC9 should be configured in alternate function mode.
  * @param  RCC_MCOx: specifies the output direction for the clock source.
  *          This parameter can be one of the following values:
  *            @arg RCC_MCO1: Clock source to output on MCO1 pin(PA8).
  *            @arg RCC_MCO2: Clock source to output on MCO2 pin(PC9).
  * @param  RCC_MCOSource: specifies the clock source to output.
  *          This parameter can be one of the following values:
  *            @arg RCC_MCO1SOURCE_HSI: HSI clock selected as MCO1 source
  *            @arg RCC_MCO1SOURCE_LSE: LSE clock selected as MCO1 source
  *            @arg RCC_MCO1SOURCE_HSE: HSE clock selected as MCO1 source
  *            @arg RCC_MCO1SOURCE_PLL1QCLK:  PLL1Q clock selected as MCO1 source
  *            @arg RCC_MCO1SOURCE_HSI48: HSI48 (48MHZ) selected as MCO1 source
  *            @arg RCC_MCO2SOURCE_SYSCLK: System clock (SYSCLK) selected as MCO2 source
  *            @arg RCC_MCO2SOURCE_PLL2PCLK: PLL2P clock selected as MCO2 source
  *            @arg RCC_MCO2SOURCE_HSE: HSE clock selected as MCO2 source
  *            @arg RCC_MCO2SOURCE_PLLCLK:  PLL1P clock selected as MCO2 source
  *            @arg RCC_MCO2SOURCE_CSICLK:  CSI clock selected as MCO2 source
  *            @arg RCC_MCO2SOURCE_LSICLK:  LSI clock selected as MCO2 source
  * @param  RCC_MCODiv: specifies the MCOx pre-scaler.
  *          This parameter can be one of the following values:
  *            @arg RCC_MCODIV_1 up to RCC_MCODIV_15  : divider applied to MCOx clock
  * @retval None
  */
void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv)
{
  GPIO_InitTypeDef GPIO_InitStruct;
  /* Check the parameters */
  assert_param(IS_RCC_MCO(RCC_MCOx));
  assert_param(IS_RCC_MCODIV(RCC_MCODiv));
  /* RCC_MCO1 */
  if(RCC_MCOx == RCC_MCO1)
  {
    assert_param(IS_RCC_MCO1SOURCE(RCC_MCOSource));
 
    /* MCO1 Clock Enable */
    MCO1_CLK_ENABLE();
 
    /* Configure the MCO1 pin in alternate function mode */
    GPIO_InitStruct.Pin = MCO1_PIN;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Alternate = GPIO_AF0_MCO;
    HAL_GPIO_Init(MCO1_GPIO_PORT, &GPIO_InitStruct);
 
    /* Mask MCO1 and MCO1PRE[3:0] bits then Select MCO1 clock source and pre-scaler */
    MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO1 | RCC_CFGR_MCO1PRE), (RCC_MCOSource | RCC_MCODiv));
  }
  else
  {
    assert_param(IS_RCC_MCO2SOURCE(RCC_MCOSource));
 
    /* MCO2 Clock Enable */
    MCO2_CLK_ENABLE();
 
    /* Configure the MCO2 pin in alternate function mode */
    GPIO_InitStruct.Pin = MCO2_PIN;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Alternate = GPIO_AF0_MCO;
    HAL_GPIO_Init(MCO2_GPIO_PORT, &GPIO_InitStruct);
 
    /* Mask MCO2 and MCO2PRE[3:0] bits then Select MCO2 clock source and pre-scaler */
    MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO2 | RCC_CFGR_MCO2PRE), (RCC_MCOSource | (RCC_MCODiv << 7U)));
  }
}

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