2017-11-10 07:06 PM
Hi folks!
I'm working with a Netduino, which has an STM32F4, running at 168MHz.
I'm trying to doa calculation (specifically the following), which needs the ADC frequency (
Fadc
) and number of sampling periods (k
:(I'm having a little trouble tracking these down, however.
Tackling
Fadc
first, , which is peripheral clock / 2 (according to the note next toit). I’m pretty sure from my reading that the peripheral clock is the same as the MCU clock, and my MCU is set to 168MHz. So 168MHz / 2 = 84MHz. However, the data sheet says that the ADC Clock Frequency (fADC) is between 30 and 36MHz for VDDA of 2.5V to 3.6V, and the VDDA on the Netduino should be around 3.3V. So what is the actual value here?For the number of sampling periods, Ifound the following in source:
#
define
STM32_AD_SAMPLE_TIME
2
//
sample time = 28 cyclesADC1->SMPR1 =
0x00249249
*
STM32_AD_SAMPLE_TIME;
So SMPR1 has a hex value of 0x00249249 which is2,396,745 in base 10, so I get 4,793,490 for the number sampling periods, but that can't be right either, considering when I was looking at a sample for the STM32F1, it had a sampling time of 8:
With my answer 6 orders of magnitude off, I think it's probably not right. So I'd appreciate the help.
2017-11-14 09:40 AM
There must be some other place where it's being set, though we can't seem to find it.
I'll keep digging. Until I know
Fadc
, I can't do the resistance calc.:(