STM32 digital output, ringing

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,752
Look at this:

1707076950661.png

Is this an inherent characteristic of the device and we need to use a capacitor to "filter" it out or what? It is just a 50% duty cycle, timer (interrupt) driven GPIO pin.
 

MrChips

Joined Oct 2, 2009
31,171
Is this an inherent characteristic of the device and we need to use a capacitor to "filter" it out or what? It is just a 50% duty cycle, timer drive GPIO pin.
No. Your oscilloscope is showing about 50ns ringing.
Make sure that you use a x10 attenuation probe AND the probe grounding clip is connected to circuit GND.
 

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,752
No. Your oscilloscope is showing about 50ns ringing.
Make sure that you use a x10 attenuation probe AND the probe grounding clip is connected to circuit GND.
Ahh, thanks. I have one of these that's attached to the board's ground and the GPIO pin:

1707077644902.png

Here's the details.
 

MrChips

Joined Oct 2, 2009
31,171
That is a simple BNC cable with no attenuation and no proper cable termination.

x1/x10 attenuation probe has a switch on the body of the probe to select x1 or x10 attenuation.
I always have my probes set to x10 attenuation. Before using the probe you need to adjust the trim capacitor for flat frequency response.

1707078776666.png
 

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,752
I just had a nightmare with the USB drives, but never mind.

Here's the scopes built in 1 KHz test signal, using a Siglent 200 MHz probe set to 10X and the scope input channel set to 10X.

1707081306898.png
 

Papabravo

Joined Feb 24, 2006
21,342
This happens when there is a severe impedance mismatch. A typical 10x scope probe has 10 MegΩ with 15 pF to Ground. the idea is to avoid disturbing the circuit under test.
 
Last edited:

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,752
OK I adjusted the probe using the supplied trimming tool and got the test waveform square.

I then re-attached the probe to the board, leaving everything set at 10X, here's the waveform and the original waveform for comparison:

1707082221349.png
1707082049853.png
 

Attachments

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,752
Finally there was a 8 inch piece of wire between the probe ground crocodile clip and the board ground pin, I rearranged that and made it 1 inch (because the crocodile clip shorts against other pins):

1707082913069.png

I think I underestimated the impact of poor connection leads between device and scope, that seems to be the upshot of all this.
 

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,752
I did one more change and altered the GPIO pins slew rate from HIGH to LOW (there are four speed constants)

1707084635681.png

Here's the waveform now:
1707084738694.png

Once upon a time I understood this stuff pretty well, but its been many years.
 

MrChips

Joined Oct 2, 2009
31,171
Finally there was a 8 inch piece of wire between the probe ground crocodile clip and the board ground pin, I rearranged that and made it 1 inch (because the crocodile clip shorts against other pins):

I think I underestimated the impact of poor connection leads between device and scope, that seems to be the upshot of all this.
8 inches is way too long.
If you want to do high frequency probing, here is what we use. That is less than 1 cm from the probe GND to the circuit GND.

1707085066603.png
 

crutschow

Joined Mar 14, 2008
34,894
That makes sense, but in this case the generated signal is just 27KHz, surely that's not what you'd call "high frequency"?
No.
But it's not the fundamental repetition frequency that's the problem, it's the rise and fall times that have much higher Fourier frequencies which you must accurately resolve.

For a more-or-less linear rise and fall, the approximate equivalent highest frequency component is 0.35/τ where τ is the 10%-90% rise or fall time of the pulse.
From post #9, It looks like you original pulse fall time is <10ns, giving frequency components above 35MHz.
 
Last edited:
Top