clock - STM32 Output MCO configuration -
i try configure mco ouput on stm32f103, std periph lib.
here code:
void outputmco() { gpio_inittypedef gpio_initstructure; rcc_apb2periphclockcmd(rcc_apb2periph_gpioa, enable); /* output clock on mco pin ---------------------------------------------*/ gpio_initstructure.gpio_pin = gpio_pin_8; gpio_initstructure.gpio_mode = gpio_mode_af_pp; gpio_initstructure.gpio_speed = gpio_speed_50mhz; gpio_init(gpioa, &gpio_initstructure); // pick 1 of clocks spew //rcc_mcoconfig(rcc_mcosource_sysclk); // put on mco pin the: system clock selected //rcc_mcoconfig(rcc_mcosource_hse); // put on mco pin the: freq. of external crystal //rcc_mcoconfig(rcc_mcosource_pllclk_div2); // put on mco pin the: system clock selected }
i have issue here:
// pick 1 of clocks spew //rcc_mcoconfig(rcc_mcosource_sysclk); // put on mco pin the: system clock selected //rcc_mcoconfig(rcc_mcosource_hse); // put on mco pin the: freq. of external crystal //rcc_mcoconfig(rcc_mcosource_pllclk_div2); // put on mco pin the: system clock selected
none of 3 possibilities working on code. code found on internet. know should find correct parameters ? definition of rcc_mcosource doesn't me thank you
i found solution in file stm32f10x_rcc:
#define rcc_mco_noclock ((uint8_t)0x00) #define rcc_mco_sysclk ((uint8_t)0x04) #define rcc_mco_hsi ((uint8_t)0x05) #define rcc_mco_hse ((uint8_t)0x06) #define rcc_mco_pllclk_div2
Comments
Post a Comment