PWM jitter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 5:37 AM
Hello,
I am currently in the midst of developing a super simple system to create a varying load. It's basically to resistors in series with a transistor in parallel of the second resistor. The transistor is driven by a PWM signal to bypass the second resistor and modify the load.
I've been trying the circuit with a function generator and it's working perfectly.
I now need to switch the PWM generation to a timer of a STM32. I have a nucleog474RE.
I used one of the example code available via cubeIDE (TIM_PWMOutput) and changed the frequency to match what i need (3.2kHz) but whenever I try and use my circuit with it, the signal generated by the nucleo is nowhere near clean and smooth, there is a huge jitter that basically renders my circuit useless (I need very high precision and stability).
Would any one have any idea why this is happening and what to do to correct it ?
Thanks for the answers !
Solved! Go to Solution.
- Labels:
-
STM32G4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 5:56 AM
The Nucleo G474 has an external XTAL please use it, hopefully it will improve accuracy,
configure Crystal/ceramic for HSE as follow:
Select HSE as input for the PLL and enter 170 in HCLK:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 5:39 AM
The jitter makes the frequency vary between 3.200kHz and 3.205kHz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 5:43 AM
Hello,
What clock are you using as source for the PLL ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 5:47 AM
Not quite sure, I think the internal clock...
Here is a screenshot.
I'm very new to all this so I'm not always sure about what I'm doing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 5:56 AM
The Nucleo G474 has an external XTAL please use it, hopefully it will improve accuracy,
configure Crystal/ceramic for HSE as follow:
Select HSE as input for the PLL and enter 170 in HCLK:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-16 6:52 AM
I just changed it and it worked perfectly !
Thanks for the advice !
