Check HSE using MCO

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

Moderators: barthess, RoccoMarco

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

Check HSE using MCO

Postby nikhil » Sat Feb 15, 2014 1:36 am

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
Location: India

Re: Check HSE using MCO

Postby Abhishek » Sat Feb 15, 2014 4:58 am

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

Postby nikhil » Sat Feb 15, 2014 5:37 pm

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
Location: India

Re: Check HSE using MCO

Postby Abhishek » Sat Feb 15, 2014 6:03 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 9 guests