2015-10-23 05:43 AM
Hi, is there any difference how exactly I'm getting the desired clock speed on SYSCLK through PLL? For example, let's say I want to have 48MHz on SYSCLK on STM32F407, using a 8 MHz HSE and the PLL. One way of doing it would be this:
HSE = 8MHzM = 8N = 384
P = 8
Q = 8
--------
SYSCLK = 48MHz Another way of doing it would this:
HSE = 8MHz
M = 4
N = 96
P = 4
Q = 4
--------
SYSCLK = 48MHz So my question is: is one of these two ways better than the other (i.e. lower jitter, or lower power consumption), and why? Thank you.
2015-10-23 05:51 AM
RM0090, rev.10 p.226, description of PLLM
Caution: The software has to set these bits correctly to ensure that the VCO input frequency ranges from 1 to 2 MHz. It is recommended to select a frequency of 2 MHz to limit PLL jitter. JW2015-10-23 06:00 AM
Thanks, I missed it. So my second example is better because HSE/M = 2 opposed to HSE/M = 1 of the first example? And the N and P values don't affect the jitter?
2015-10-23 06:33 AM
This is all I know, I am not an ST insider. The ''2MHz causes less jitter'' is not quantified further either. The datasheet says, PLL input clock Typ 1MHz, which is confusing too.
OTOH, both N and P are purely digital dividers, whereas the PLL input frequency goes into the phase detector/feedback loop which is sort of analog, so I can imagine this is the case. JW2015-10-23 07:02 AM
You also have to know that PLL_N must be at least 192 for proper working, according to the Reference manual.
These PLL combinations also needs to be set properly for other clock settings such as USB FS, LTDC, etc.2015-10-23 07:09 AM
> You also have to know that PLL_N must be at least 192 for proper working, according to the Reference manual.
That's interesting, it means there is a bug in Cube's clock validation algorithms, because it doesn't mind if I set HSE=8,M=4,N=96,P=4,Q=4. Edit: Or maybe the 192MHz is for the output after the *N, that is (HSE / M) * N should be >=192 and <= 432. In my example it's (8 / 2) * 96 = 192, so it's valid. Edit 2: Nope, clearly Cube has a bug, it accepts even if I set HSE=8,M=4,N=50,P=4.2015-10-23 07:20 AM
>You also have to know that PLL_N must be at least 192 for proper working, according to the Reference manual.
No, it was just a badly and confusingly formulated ''PLL VCO output frequency must be 192 to 432MHz, for the PLL input frequency of 1MHz it means N between 192 and 432''. Download and check out the latest Rev10 of RM0090. JW2015-10-23 07:39 AM
Cube, or CubeMX?
(Not that I would care.) JW2015-10-23 07:44 AM
You are right, it's STM32CubeMX.
2015-10-23 11:37 AM
Is this true for all STM32 series?