Skip to main content
May 6, 2015
Question

how to enable Clock-out capability (MCO Pin)

  • May 6, 2015
  • 1 reply
  • 539 views
Posted on May 06, 2015 at 13:00

I want to have a sample of system clock at MCO pin of STM32F107RC micro controller.

I use dspin firmware library for driving stepper motor.

The on board crystal is 8MHz and system clock set to be 72MHz.

I add this code to ''dspin.c'':

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

and I add the below line code in ''SetSysClockTo72()'' function at ''system_stm32f10x.c'' file.

RCC->CFGR &= (uint32_t)0xF6FFFFFF;   //HSE clock selected as MCO source

But I don't have no clock output on this pin.

please guide me

thanks

yasamin
    This topic has been closed for replies.