Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 10 months ago.
MCO on nucleoF401
Hi
Im trying to access the MCO pin on the f401 nucleo so I can supply a clock signal to a OV7670 (without FIFO). Can I access and setup this pin as a clock output with mbed?
thanks
2 Answers
9 years, 10 months ago.
There is no direct function , you have to set up the IO and clock register to select and output the clock :
GPIO_InitTypeDef InitStruct; HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_1); // select PLLCLK as source /*Configure GPIO pin to output clock signal at PA8 */ InitStruct.Pin = GPIO_PIN_8; InitStruct.Mode = GPIO_MODE_AF_PP; InitStruct.Pull = GPIO_NOPULL; InitStruct.Speed = GPIO_SPEED_HIGH; InitStruct.Alternate = GPIO_AF0_MCO; HAL_GPIO_Init(GPIOA, &InitStruct);
9 years, 10 months ago.
Alternatively, the 8MHz xtal MCO of the ST-Link portion of the Nucleo is available on the underside of the board at SB16 (& SB50 if SB16 is bridged). That's assuming you haven't snapped off the ST-Link!.