Page 1 of 1
Check HSE using MCO
Posted: Sat Feb 15, 2014 1:36 am
by nikhil
I am using STM32F405 mcu and 8MHz external crystal oscillator. I want to check if my external crystal oscillator is working properly. Is it possible to check HSE clock using MCO pins (PA8/PC9)?
I have set STM32_HSECLK to 8000000. Do I need to change any other parameter?
What should be the pin configuration for MCO pins in order to do this?
--
Nikhil
Re: Check HSE using MCO
Posted: Sat Feb 15, 2014 4:58 am
by Abhishek
Once you set MCO configuration in mcuconf.h, and set the appropriate GPIO port to Alternate function 0, you should be able to receive the system clock output on that particular pin.
Regards
Abhishek
Re: Check HSE using MCO
Posted: Sat Feb 15, 2014 5:37 pm
by nikhil
Hello,
Thanks for your answer.
Is there any option to select which clock (HSE, HSI, PLL) to recieve at MCO?
--
Nikhil
Re: Check HSE using MCO
Posted: Sat Feb 15, 2014 6:03 pm
by Abhishek
Yes, see this in mcuconf.h
Code: Select all
#define STM32_MCO1SEL STM32_MCO1SEL_HSI // Select clock source here
#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 // MCO = fClk / Prescale value
#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK
#define STM32_MCO2PRE STM32_MCO2PRE_DIV5
You have to modify these lines.
Regards
Abhishek