Skip to main content
PDieh.1
Associate II
Aug 29, 2023 12:55 PM UTC
Question

STM32F410 PLL Jitter on PWM

Hello,

i want to use a really precise PWM signal but i get a lot of Jitter on it.

I am using the F410 with a 16Mhz crystal. The PLL produces from there a Frequency of 100Mhz (I need this high frequency for my other tasks).
The rest of my hardware needs one PWM signal with 1kHz and a 5ms on time. So i use a PWM Timer for that.
The problem now is, that the edges of this signal have a lot of jitter, around 3ns both on the on-time aswell on the period.
If i deactivate the PLL and directly use the 16MHz crystal for comparison, the jitter is much lower, around 0,5ns.

In the datasheed of the uC is a Table 44 about the Main PLL characteristics and in there is the Jitter with +-150ps much lower. As i see it, the chip has no option to add a external VCO-capacitor to the PLL.
Do anyone know, where this differences between datasheet and hardware come from and how can i fix this?

Best regards,
Philipp Diehl

This topic has been closed for replies.

26 replies

ST Employee
Aug 29, 2023 4:12 PM UTC

Hello @PDieh.1 , 

There are several potential causes for this, which may be more difficult to pinpoint without the code...

Have you tried using 2 PLL in parallel, it could degrade the jitter up to 30%

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
PDieh.1
PDieh.1Author
Associate II
Sep 1, 2023 5:28 AM UTC

Hello @Sarra.S ,

thanks for the reply!
How do i do that? The F410 has only one build-in PLL.
Do i need a external one for this and do i just attatch it to the RCC_OSC_IN pin?.
I think, then i would still have the limitation of the max. 26MHz input frequency.

Best Regards,
Philipp

STOne-32
ST Technical Moderator
Aug 29, 2023 9:23 PM UTC

Dear @PDieh.1 ,

The jitter observed is a combination of PLL indeed , I/Os activity ( when running at high speed) and also affecting  I/O power supply .

Here are some hints , trials your can do to see the effect or minimize it :

1) at PLL input , select M factor of 8 instead of 16  to get PLL input 2MHz instead of 1MHz , your VCO will be higher at 200MHz.  
2) activate slew rate I/O toggling instead of max speed ( Using as much as possible 00 / 01 and avoid 11 ) 

3) check you bypass capacitors and your 100nF on VDD pairs and on VCAP of 4,7uF 

4) if you are running at VDD at 3,3 Volts , activate the I/O compensation cell / this will slow down the fast process of our transistors .

5) as said by @Sarra.S , avoid activating other  PLLs : USB or Audio .

let us know if it helps with these testings ?

Ciao,

STOne-32

PDieh.1
PDieh.1Author
Associate II
Sep 1, 2023 5:42 AM UTC

Hello @STOne-32 ,

Thank you for your detailed response.

1) i already had M factor at 8. Is a lower Value here better?
2) there is only the pins for the SPI interface at 11 (default, i did not specify this). All other Pins are at 00
3) As i see it, the capacitors are all present and correctly sized
4) We are running at 3,3V. Activating this Cell showed no effect
5) All other PLL are off. I think, it is the only PLL in the System, No USB or Audio (it is a custom board)

I tested the PWM-Jitter on a nucleo-L433RC-P and there the jitter is only about 1ns.
Is this PLL different then the one in the F410?

Best regards,
Philipp

ONadr.1
Senior III
Sep 1, 2023 6:00 AM UTC

Perhaps using a precision external oscillator instead of the internal and crystal would help. The internal one is exposed to the influence of internal signals and its stability can be affected by turning on the PLL. It can also be subject to interference on the leads and capacitors of the external crystal if not properly designed.

STOne-32
ST Technical Moderator
Sep 1, 2023 7:19 AM UTC

Dear @PDieh.1 ,

Thank you for the testing's. Yes, F410 and L433 are not the same product and not using same technologies of  blocks - both are 90nm process but different designs to serve different market applications.    I believe that this jitter is linked to I/O activity, but the way the Package is LQFP64 ? , if possible we can do the same test in our lab using nucleo and try to find out the root-cause.   @Sarra.S .

Ciao,

STOne-32

PDieh.1
PDieh.1Author
Associate II
Sep 1, 2023 7:39 AM UTC

Hello @STOne-32 
on our custom board is the STM32F410CBU3 UFQFPN48
My other testboards are standard nucleo-L433RC-P and Nucleo-F410RB
All with external crystal or signal generator on RCC_OSC_IN pin.
Thank would be great, because i testet all of this aswell without any other application running:
Only the PWM-Timer was flashed to the chip.

Best regards,
Philipp

ST Employee
Sep 1, 2023 3:24 PM UTC

Hello @PDieh.1, 

Could you please specify the capacitor values (C47 and C48) that u used with HSE in Nucleo-L433 

C33 and C34 in Nucleo-F410 as well 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
PDieh.1
PDieh.1Author
Associate II
Sep 5, 2023 7:47 AM UTC

Hello @Sarra.S 
those capacitors are not assembled. For my tests, i have used an signal generator Agilent 33220A and directly put the squarewave to the Pin PH0 (RCC_OSC_IN) and the HSE in BYPASS Clock Source mode.
I do not use the crystal here.
On my custom breadboard i have two 15pF with a 16MHz crystal.

Best regards,
Philipp

ST Employee
Sep 5, 2023 2:42 PM UTC

Hello @PDieh.1 ,  

Yes, of course, I already prepared a code snippet based on your description to test the PWM jitter on both NUCLEO-F410 and NUCLEO-L433, but reproducing your same conditions will be optimal! 

Meanwhile, I will also be testing Jitter on PLL with MCO output for both products, to isolate the source of the jitter, you may also want to test that! 

You can email me your test code, and any other relevant test conditions! 

 

Thank you!  

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
PDieh.1
PDieh.1Author
Associate II
Sep 6, 2023 8:13 AM UTC

Hello @Sarra.S 

sadly, i don't have your E-Mail, so i will attach the Files here.
I attached a 16MHz, 50% 3,3V squarwave signal to the PH0 Pin and the oszilloscope to PA3 on F410 and PA0 on L433.
Here is what i meassured: (On the top is the PWM signal, on the bottom zoomed in there is in yellow on the left the first falling edge of the upper signal and in blue the next rising edge, both with persitence on)
F410 with internal Clock and PLL: Falling edge (yellow) Jitter ~20ns, rising edge ~1,5µs Jitter
F410withInternalCLockandPLL.png

F410 with external Clock and PLL: Falling edge (yellow) Jitter ~3ns, rising edge ~3,5ns Jitter
F410withexternalClockandPLL.png

F410 with external Clock without PLL: Falling edge (yellow) Jitter ~0,5ns, rising edge ~0,5ns Jitter
F410withExternalClockandnoPLL.png

L433 with internal Clock and PLL: Falling edge (yellow) Jitter ~6ns, rising edge ~1µs Jitter
L433withInternalClockandPLL.png

L433 with external Clock and PLL: Falling edge (yellow) Jitter ~1ns, rising edge ~1ns Jitter
L433withexternalClockandPLL.png

Is it correct, that the internal clock is that unprecise?
Do i have an error somewere?
I hope, this helps.

Best regards,
Philipp

AScha.3
Super User
Sep 6, 2023 9:13 AM UTC

>Is it correct, that the internal clock is that unprecise?

yes. what can you expect from an r-c oszillator ?  not much.... :)

and from my very limited tests (on I2S clock from pll on F411 ) i remember: STM cpu jitter was quite bad, just fulfilling the minimum required for "consumer audio" (even cheap ESP8266 was better)

afair it was about 300ppm .

If you feel a post has answered your question, please click on " Best Answer ".
Tinnagit
Senior II
Sep 6, 2023 8:37 AM UTC

I think that it's a normal behavior with GPIO which 3ns jitter is very short to compare with 1KHz.
On my experience, the jitter can be appear with another device that had same ground and it also had high frequency.
So you should try to change your instrument which it had about 1Gsps, it can make 3ns jitter too.
I think you should find what is real problem.

Somehow every GPIOs is require a it load and almost of device's input need some base bias for their transistors so you should have a 50ohm or 100Ohm or some nearly value series with each GPIOs that was used and it also reduce a jitter level too.

PDieh.1
PDieh.1Author
Associate II
Sep 7, 2023 1:57 PM UTC

Hello @Tinnagit 

my oscilloscope is plugged in to a isolating transformer an besides the Signal Generator for the external clock, nothing else is connected to the nucleo.
I don't really get what you mean with the 1Gsps. My scope is at 2.5Gsps

I added a 100Ohm resistor between the Timer pin and ground but it had no effect on the jitter.
All it did was reducing the gradient between high/low.

Best regards,
Philipp

Tinnagit
Senior II
Sep 13, 2023 7:08 AM UTC

I guess your oscilloscope sampling frequency from your jitter information.
because there are no another stuff on your system can be operate over 200MHz which it can be make some jitter under 5ns so your jitter less than 3ns that it may make by another stuff.

and the other condition is jitter behavior is only the edge of pulse which it can be make by 2 causes (that I known)
1. Indicator sampling - your AC Isolate, it reduce noise from other switching device on AC Line but it's no effect with own switching -> your should try to use differential probe with isolate GND between your indicator and device. I guess your will got more perspective.

2. device supply do not fast enough to recovery voltage - which this condition has 2 places first is internal regulator in stm32 and the other one is regulator supply on board.
but if this condition is root-cause, you should test by run switch many GPIO and you will see another jitter on same GPIO too because it's use same regulator.
- for this condition I think a IC buffer that support more speed than stm32 GPIO may can help to reduce this.

Lucky be with you.

LCE
Principal III
Sep 6, 2023 1:44 PM UTC

You said "breadboard", that alone might be the cause for more jitter than expected.

Did you set the GPIOs to maximum output speed?

PDieh.1
PDieh.1Author
Associate II
Sep 7, 2023 5:31 AM UTC

Hello @LCE 

i call it breatboard, but in reality it is smaller than a nucle board and for most of the upper tests, i used a standard nucleo.
All GPIO are an minimum speed (00) for the tests, in my application only the pins for SPI are on max speed.

Best regards,
Philipp

LCE
Principal III
Sep 7, 2023 5:50 AM UTC

Okay, better stay with the Nucleo for these tests, unless your breadboard has a ground plane, short connection between crystal and MCU, good voltage decoupling, and so on...

Speaking of layout issues, there are some signal lines on the Nucleo which are absolutely terrible concerning routing, due to the fact that they are connected to (several) connectors.
So you might want to check the Nucleo layout files, maybe you got one of the worst signal lines.

I never used the F4, but with all my G4, F7 and H7 projects I always used the SAI / SPDIF TX for testing, always sourced by the internal PLL, with a 32 bit sine. Audio quality was always very good (>140dB SNR & THD, the limits of my SPDIF receiver CS8422), even with the clock input from the ST-link STM32.

The internal HSI / RC oscillator is completely unusable for almost anything related to signals.

ST Employee
Sep 11, 2023 4:04 PM UTC

Hello @PDieh.1, 

I propose trying these steps in your jitter measurement: 

1. Configure your scope to measure all the sampled clock periods instead of just the first clock

2. Configure your scope to capture multiple periods on the screen

3. Record mean, standard deviation, and the peak to peak values 

4. Repeat steps 2 and 3 25 times

Then we'll compare our results, I did those tests and the jitter looks okay (I used a scope with 50Gsa/s)  

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
PDieh.1
PDieh.1Author
Associate II
Sep 25, 2023 11:56 AM UTC

Hello @Sarra.S ,

Sorry for the late answer, but i am not really sure what you mean with the first step.
What are all the sampled clock periods?

PDieh.1
PDieh.1Author
Associate II
Oct 18, 2023 8:50 AM UTC

Hello @Sarra.S 

Can you please explain, what you mean with that?