cancel
Showing results for 
Search instead for 
Did you mean: 

I generate a PWM signal on a pin going from duty cycle 0 to 100 and back to 0% to generate a sine wave using an LC Filter. When I connect the LC filter, the output is still an PWM with some spikes. C = 147µF L = 47µH f = 1,91 kHz

MSpir.2
Associate II

0693W00000LxazgQAB.jpg

6 REPLIES 6

> When I connect the LC filter

How exactly?

JW

TDK
Guru

Did this really need another topic?

https://community.st.com/s/question/0D53W00001UWkTxSAL/pwm-signal-resonancedistorted-when-adding-lc-filter

If you feel a post has answered your question, please click "Accept as Solution".

problem of that topic is solved

facing other now

0693W00000LxbYbQAJ.jpg

It's the same underlying issue as the other one. The STM32 isn't outputting the spikes, it's an artifact of how you're measuring.

Probably wise to reduce GPIO speed to mask some of the effect.

If you feel a post has answered your question, please click "Accept as Solution".
MM..1
Chief II

You disconnect something ... Too maybe you need learn I=U/R (pin can drive only limited current)

Normal PWM use RC not LC .