Check HSE using MCO

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
nikhil
Posts: 40
Joined: Thu Jan 03, 2013 8:46 pm

Check HSE using MCO

Post 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
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Check HSE using MCO

Post 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
nikhil
Posts: 40
Joined: Thu Jan 03, 2013 8:46 pm

Re: Check HSE using MCO

Post by nikhil »

Hello,
Thanks for your answer.
Is there any option to select which clock (HSE, HSI, PLL) to recieve at MCO?


--
Nikhil
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Check HSE using MCO

Post 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
Post Reply