Sampling Frequency of ADC on STM32F4 Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-07 02:42 AM
Hi. I'm fairly new to the concepts of ADC and currently, I'm using STM32F4 Discovery. For ADC, I have these settings for my ADC settings in my ADC_init() (source codes from an author online).
ADC_CommonInitStruct.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled; ADC_CommonInitStruct.ADC_Mode = ADC_Mode_Independent; ADC_CommonInitStruct.ADC_Prescaler = ADC_Prescaler_Div4; ADC_CommonInitStruct.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles; ADC_CommonInit(&ADC_CommonInitStruct);and my ADC channel config is:ADC_RegularChannelConfig(ADC1, channel, 1, ADC_SampleTime_15Cycles);How do I calculate sampling frequency of my ADC from these values? #adc #adc-sampling-rate #stm32f4-discovery- Labels:
-
ADC
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-07 06:39 AM
For 12-bit sampling
SAMPFREQ = (APBFREQ / 4) / (12 + 15)Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-07 07:13 PM
Hi. May I know what APBFREQ is and where I can find its set value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-08 07:53 AM
The speed the APB (peripheral bus) to which the ADC is connected. So on the F4, APB2, probably 84 MHz depending on how you have configured it.
{ RCC_ClocksTypeDef RCC_ClockFreq;RCC_GetClocksFreq(&RCC_ClockFreq);
printf(''%d\n'', RCC_ClockFreq.PCLK2_Frequency);}Up vote any posts that you find helpful, it shows what's working..
