2009-03-01 08:13 PM
HSI->MCO and RTC->LSE configuration
2011-05-17 04:04 AM
So I have been trying to get the HSI clock as the MCO and output it on pin#67, PA8. I am using a STM32F103 VB chip.Following is my code for it.
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init(GPIOA, &GPIO_InitStructure); RCC_MCOConfig(RCC_MCO_HSI); I can see in my RCC_CCR that my HSI is on and stable/ready. Also on executing the code I can see in my register that HSI is used as MCO source. When I try to see the signal on a scope, the HSI clock is not outputted on pin PA8 #67. I have the same issue with RTC, I am using the LSE clock 32 Khz to output on pin#7, PC13-Tamper RTC. Again I can see in my registers as I step through the following code that the LSE is on, LSE is selected as RTC clock. /* Enable PWR and BKP clocks */ RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE); /* Allow access to BKP Domain */ PWR_BackupAccessCmd(ENABLE); /* Reset Backup Domain */ BKP_DeInit(); /* Enable LSE */ RCC_LSEConfig(RCC_LSE_ON); /* Wait till LSE is ready */ while (RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET) {} /* Select LSE as RTC Clock Source */ RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE); /* Enable RTC Clock */ RCC_RTCCLKCmd(ENABLE); /* Wait for RTC registers synchronization */ RTC_WaitForSynchro(); I am using both clocks to clock my CPLD ( they are already routed to the CPLD clock pins). Any recommendations or troubleshooting tips would be really appreciated.2011-05-17 04:04 AM
siddj;
You forgot to enable the APB alternate function clock on APB2. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_AFIO , ENABLE);2011-05-17 04:04 AM
My RTC clock issue was resolved, thanks!
Has anyone outputted the MCO on a GPIO A8 pin before?