2009-01-28 04:16 AM
Master Clock Out (MCO)
2011-05-17 03:56 AM
The Cortex m3 documentation implies that the MCO can be output on the cooresponding GPIO pin. I can not find any reference to the MCO alternate output in RM0008.
Does anyone know how to output MCO on to a GPIO pin? :-?2011-05-17 03:56 AM
MCO output is controlled from the RCC_CFGR register along with assigning the appropriate GPIO pin for alt func out.
Here's how I did it using the ST FW lib on the ST3210E-EVAL board from ST: // Put the system clock on the MCO pin GPIO_InitTypeDef GPIO_InitStructure; 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); RCC_MCOConfig(RCC_MCO_SYSCLK); You would execute those lines after the clocks are configured. Don't forget to turn on the GPIO bus clock. JJS2011-05-17 03:56 AM
Can somebody help me to set MCO exactly at 12.288 Mhz (Pin PA8). I have a problem with starting I2S external codec (PCM3003 by TI).
I couldn't find it in I2S_codec source files provided by STM. Maybe another nice method for setting master clock for external codec.2011-05-17 03:56 AM
Hi jaroslaw.oska;
I don't know what's the accuracy value of the I2S clock. Did you try the HSI clock? you can tune your frequency by around 40Khz this by configuring the HSITRIM bits in RCC_CR register. There are 32 different values of HSI frequency. You can try different values of PLL mul/div values to have your I2S clock. B.R. M3allem2011-05-17 03:56 AM
Like m3allem suggested you could trim the internal clock & multiply by 2 in the PLL to get approximately this value, my worry with temperature fluxuations and inaccuracy of the internal clock you won't get as close as you may need.
There are 12.228 or 3.072Mhz & 4.096Mhz crystals which will produce the required frequency with the PLL. Remember MCO output is PLL/2. John.Speth code should work. Todd