Hello. When I use external crystals, I have a low frequency (2Hz) disturbance on PWM outputs. This disturbance also appear on SWDIO & SWCLK pins. But everything is ok with internal oscillator. The MCU is STM32f401RBT6. Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-05 8:25 AM
The first image is PWM output when using internal oscillator & The second image is PWM output when using external crystal.
- Labels:
-
STM32F4 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-05 12:32 PM
Probably your clock source is getting disrupted. Pipe MCO to an output pin and measure that on the scope along with your PWM signal.
Could also be your chip is getting reset at regular intervals, or timer is getting disabled.
As for why? Hard to say without seeing more information. You can read this for proper selection/wiring of crystals:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-06 3:46 AM
Thank you for your help. The MCO output is OK.
This image is MCU output.
I also found that the frequency of the disturbance varies with PWM frequency.
For example the frequency of the disturbance is 2 Hz when PWM output frequency is 15000 Hz &
the frequency of the disturbance is 0.5 Hz when PWM output frequency is 3750Hz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-06 7:58 AM
The timer peripheral isn't likely to contain a glaring hardware error which would cause this. The STM32F4 family is very mature. I would look at your code to see what might be causing this to happen. Perhaps in an ISR routine affected by the frequency of this particular timer somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-06 9:42 PM
Yes, Of course.
Here you are.
The code is very simple and we don't have any ISR routines. We just have a PWM signal with frequency = 15KHz & Duty cycle = 50%.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-06 11:22 PM
Try to switch off CSS.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-07 2:38 AM
Thank you for your attention. I tried that. Nothing was changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-07 10:55 AM
Try your code on a "known good" hardware such as Nucleo or Disco board.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-09 12:10 AM
Thanks. I did it. The disturbance was not removed.
I found that when we remove deadtime, The disturbance is removed.
But I need deadtime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-22 7:21 AM
Hello. I found that when the PWM period is an integer multiple of the dead time, The disturbance is removed.
Do you know why this happens?
Do you know anything about this fact?
Thank you so much.
