The pa.8 pin of the STM32 has a multiplexing function-clock output (MCO), which enables the STM32 internal clock to be output through pa.8.
Operation Flow:
1), set pa.8 to multiplex push-pull mode.
Gpio_initstructure.gpio_pin = Gpio_pin_8;
Gpio_initstructure.gpio_speed = Gpio_speed_50mhz;
Gpio_initstructure.gpio_mode = gpio_mode_af_pp;
Gpio_init (Gpioa, &gpio_initstructure);
2), select the output clock source.
The selection of the clock is controlled by the mco[2:0] bit in the clock configuration register (RCC_CFGR).
Rcc_mcoconfig (RCC_MCO);
The parameter Rcc_mco is the internal clock to be output:
Rcc_mco_noclock---No clock output
RCC_MCO_SYSCLK---output system clock (SYSCLK)
RCC_MCO_HSI---Output internal high-speed 8MHZ RC oscillator clock (HSI)
Rcc_mco_hse---Output high speed external clock signal (HSE)
RCC_MCO_PLLCLK_DIV2---output PLL double-frequency clock (PLLCLK/2)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.