cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L15x Microcontroller Clock Output Enable

valeriogiampa
Associate II
Posted on March 24, 2012 at 20:13

I would like to see the System Clock of my STM32L152.

For this reason, I have included in my project this function:

 /* Enable External Clock Output MCO on Pin48 - GPIOA.8 */  // Addizionale

  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA | GPIO_Pin_8, ENABLE);

 /* Configure User Button pin as Alternative Function */

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;

  GPIO_InitStructure.GPIO_Mode = GPIO_AF_MCO;

  //GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

  /* Configura l'RCC per estrarre il clock desiderato */

  RCC_MCOConfig(RCC_MCOSource_SYSCLK , RCC_MCODiv_16);

But, I don't see any signal on the Pin PA.8.

Can anyone help me?

#stm32-mco-clock-output
1 REPLY 1
Posted on March 24, 2012 at 23:04

The syntax of much of that looks wrong.

Perhaps:

RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource8, GPIO_AF_MCO);
RCC_MCOConfig(RCC_MCOSource_SYSCLK , RCC_MCODiv_16);

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