2012-10-13 11:32 AM
I need to measure from outside the sampling frequency of a STM32F4 discovery, I have thought about using a pin as an output, and bring it in an alternating manner to VDD and GROUND each time the DMA takes a sample from the ADC and places it in memory ! can anyone suggest me how to do such a thing? or if there are better ways to measure the frequency from the outside? thanks
2012-10-13 05:26 PM
If you want internal frequency sources you could presumably output them via the MCO pin(s)
If you are pacing an ADC via a timer, then the TIMx_CHx pins are externally visible.2012-10-14 06:45 AM
if I understand correctly I could use the command:
RCC_MCOxConfig (RCC_MCOxSource_xxx, RCC_MCO2Div_x); to take me on a clock associated to APB2 on pin MCO? but I can not find the command to bring the clock associated all'APB2 on pin MCO .... you could write a few lines of code to clarify the procedure? the sampling frequency of the ADC is FADC = (APB2 / 2) / (number of cycles) but if use more channels for example, four channels of the same ADC must divide by four FADC? thanks for the help2012-10-14 10:06 AM
If you pace the ADC rather than run it a full tilt, you'll have a much better handle on when the conversion starts.
STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\RCC/* Output clock on MCO2 pin(PC9) ****************************************/
/* Enable the GPIOC peripheral */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
/* Configure MCO2 pin(PC9) in alternate function */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* System clock selected to output on MCO2 pin(PC9)*/
RCC_MCO2Config(RCC_MCO2Source_SYSCLK, RCC_MCO2Div_2);
2012-10-14 04:15 PM
thanks for your help