cancel
Showing results for 
Search instead for 
Did you mean: 

High jitter on MCO output?

HWidj.2
Associate III

I just got my NUCLEO-H723ZG board, I loaded the GPIO_InfiniteLedToggling example project, downloaded the program to the board and it worked fine. Then I added a very simple code to output the HSE clock to an MCO pin.

/* Enable the MCO1 Clock */
  LL_AHB4_GRP1_EnableClock(LL_AHB4_GRP1_PERIPH_GPIOA);
 
  /* Configure the MCO1 pin in alternate function mode */
  LL_GPIO_InitTypeDef   gpio_InitStruct;
  gpio_InitStruct.Pin = MCO1_PIN;
  gpio_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
  gpio_InitStruct.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH;
  gpio_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
  gpio_InitStruct.Pull = LL_GPIO_PULL_NO;
  gpio_InitStruct.Alternate = ((uint8_t)0x00);  // Alt. function = MCO.
  LL_GPIO_Init(MCO1_GPIO_PORT, &gpio_InitStruct);
 
  // Enable MCO1 (Source is HSE, 8 MHz, no prescaler).
  RCC->CFGR |= ((0x2 << RCC_CFGR_MCO1_Pos) | (0x0 << RCC_CFGR_MCO1PRE_Pos));

I inspected the clock output n the scope and I can see it's very jittery. I check the board schematic and found out that the HSE is a clock signal that is generated by a secondary MCU on the board which implements the ST-LinkV3 debugger, and in itself is an MCO signal. A 25MHz clock oscillator is attached to this secondary mcu and I guess the 8 MHz MCO signal is generated from this. I inspected this clock signal and it also has high jitter! The jitter is very bad, I've never even seen this much jitter from a clock signal generated by an internal RC oscillator.

I then enabled the LSE which uses the on-board 32KHz crystal as the source for the MCO output and saw that it also has considerable jitter, certainly not what I would expect coming from a clock signal generated by an external 32KHz crystal.

Is this something to be expected from an MCO output in STM32H7 devices?

10 REPLIES 10

Thanks both for coming back with the "solutions".

> The isolator is obvious injecting the jitter.

This in an interesting observation, and not that obvious IMO.

JW