cancel
Showing results for 
Search instead for 
Did you mean: 

PWM Output distorted

nobody102
Associate II
Posted on September 05, 2016 at 20:16

Running an stm32f429-disco board.  I need to generate a clock source for another board.  The PWM parameters show my expected output of 16 mHz, 50% duty cycle.  However, when I look at the output on my scope, not exactly the best square wave.  Does this look decent enough to use as an external clock source to another device? I'm thinking it may be a setup issue with my scope/probe.  Any thoughts?

0690X00000605PBQAY.png

OK.  Update.  My rigol scope probes shows bandwidth as 1x of max 7MHz, so that may explain the issue.  I changed the probe to 10x ( max 150MHz bw), and now get the waveform below.  0690X00000605RkQAI.png

Not very nice looking either.  If it matters, I am interfacing to a Freescale SGTL5000 audio codec master clock input.  
1 REPLY 1
mark239955_stm1
Associate II
Posted on September 06, 2016 at 02:30

High-frequency square waves do tend to ring a bit on the edges.

You can add a damping circuit - just an RC filter is quite helpful.  I generally put a 68 ohm resistor and a 100pF cap in series to ground on JTAG and SWD clocks for this purpose.

You could also try playing with the drive settings on the MCU pin in GPIOx->OSPEEDR.