2012-03-24 12:13 PM
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-output2012-03-24 03:04 PM
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);