例:STM32F103系列的ADC的时钟是在APB2(最大72MHZ)上。我们可以对其分频:
RCC_PCLK2_Div2: ADC clock = PCLK2/2 //72/2=36MHz
RCC_PCLK2_Div4: ADC clock = PCLK2/4 //72M/4=18MHz
RCC_PCLK2_Div6: ADC clock = PCLK2/6 //72M/6=12MHz
RCC_PCLK2_Div8: ADC clock = PCLK2/8 //72M/8=9MHz
对ADC的通道设置不同的采样周期,所对应的采样时间也会不同:
ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles 采样时间等于1.5个周期
ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles 采样时间等于7.5个周期
ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles 采样时间等于13.5个周期
ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles 采样时间等于28.5个周期
ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles 采样时间等于41.5个周期
ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles 采样时间等于55.5个周期
ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles 采样时间等于71.5个周期
ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles 采样时间等于239.5个周期
ADC的采样时间=采样周期/ADC的时钟频率 ADC的转换时间=ADC的采样时间+12.5周期 (12.5是采集12位AD时间是固定的周期)