15
\$\begingroup\$

I got a new oscilloscope :) (proud amateur moment)

I am trying to visualize the internal clock of a STM32G431RBT6 MCU. So I built an example program given by the vendor which provides the MCU clock output on a GPIO pin. I connected my Rigol DS2202A oscilloscope (200MHz with 2GSa/s and 58Mpts) with the pin and these are the output waveforms I got.

HSE output (24 MHz)

enter image description here

PLL output in Range 1 boost mode (170MHz)

enter image description here

I am using a passive probe PVP2350 details given below

  • Specifications | 1 : 1 | 10 : 1
  • Input Impedance | 1 MΩ ± 1% | 10 MΩ ± 1%
  • Bandwidth | DC ~ 35 MHz | DC ~ 350 MHz
  • Compensation Range | 6 pF ~ 24 pF| 6 pF ~ 24 pF
  • Max. Input Voltage | CAT II 300 VAC | CAT II 300 VAC

As the speed of the MCU increases the waveform shifts from being barely square to sinusoidal. Does this have to do with my oscilloscope limitations, or is this the kind of waveform to expect from the clock out pin of an MCU? Also the Vpp is shown negative and I am trying to understand the why behind all of this data.

\$\endgroup\$
7
  • 4
    \$\begingroup\$ Oscilloscope bandwidth is defined at the -3dB point which means it starts rolling off before then. The 24MHz looks worse than I would have expected though. That's like only the 1st, 3rd and 5th harmonic of a square wave. It's almost like your scope isn't actually 200MHz. Oh yeah, post the bandwidth of your scope because it was a unneeded hassle for me to look it up. \$\endgroup\$
    – DKNguyen
    Jun 4 at 17:26
  • 5
    \$\begingroup\$ Please mention bandwidth of oscilloscope and did you use 1x or 10x probe mode to mesure that, and did you use the long crocodile clip ground lead or short ground spring? \$\endgroup\$
    – Justme
    Jun 4 at 17:28
  • 4
    \$\begingroup\$ You have a 200MHz scope. It is not able to display a 170MHz square wave. You need at least a 500 MHz one to display something looking at all square. \$\endgroup\$ Jun 4 at 17:31
  • 3
    \$\begingroup\$ It the ground comes through a crocodile clip loop, not as straight as the signal, there's a resonant stray LC circuit. That's already said indirectly in the comment above. But you obviously know at least something. I have seen cases where one uses for convenience only the GND of the other channel probe and then wonders why 10x slower signals are trashed. \$\endgroup\$
    – user287001
    Jun 4 at 17:31
  • 4
    \$\begingroup\$ About negative values.... many oscilloscopes have a menu item that inverts the display (so that you can make differential measurements with 2-channels). No MCU that I know of outputs GPIO signals that are negative, so I suspect an inverted channel. It is also concerning that displayed voltages are so low (10mV)...check for a 'scope probe menu item that may be erroneously set to X100 or X1000? \$\endgroup\$
    – glen_geek
    Jun 4 at 17:39

1 Answer 1

25
\$\begingroup\$

It's hard to see (or even generate) a 170 MHz ideal square wave.

  1. Use the 10:1 attenuation mode.

In the 24 MHz case, you probably don't have a good ground connection on your scope probe -- you need a ground wire shortened by spiral wrapping around the probe tip and connected as close as you can (few mm) to the ground of the MCU driver for that pin. Your excessive ground connection is generating a ringing from the L.C resonance of the ground wire and probe capacitance.

In the 170 MHz case, likely the pin driver can't drive the total capacitance on the pin -- that's why you see such a signal.

Tip: The best way to see these signals is to get a length of 50 Ω coax cable; connect one end to the scope (if the scope has a 50 Ω mode, use that; else insert a 50 Ω termination on the connection). Expose the wires on the far end; solder a 470 Ω (451 Ω would be ideal) resistor to the center conductor, and fashion the wires (even solder them) to touch the board at the probe points. This will give a high BW, low inductance connection between your MCU's pin and the scope.

Like this: Coax scope probe

\$\endgroup\$
6
  • \$\begingroup\$ I have seen this trick before with the 451 ohm resistor, but why? Where does it come from? \$\endgroup\$
    – Linkyyy
    Jun 4 at 18:50
  • 7
    \$\begingroup\$ It's not a 'trick'. The 451 Ω and 50 Ω cable act as a 10:1 attenuator. When the cable is terminated at the scope end with 50 Ω, there is no signal reflection, and (if the cable is not poor quality) v. high bandwidth (>> GHz), so the bandwidth limitation is only the scope. For many systems, the total ~ 500 Ω loading is not detrimental. It will actually have LESS loading than a probe's ~ 15 pF capacitance above 20 MHz. \$\endgroup\$
    – jp314
    Jun 4 at 22:48
  • \$\begingroup\$ Cool. I've been doing this stuff since the 1960's and hadn't encountered this idea. So simple, it should be obvious (but it isn't). Thanks! \$\endgroup\$
    – John Doty
    Jun 5 at 12:25
  • \$\begingroup\$ For an ideal 10:1 division you would want a 450Ω ohm resistor, but you can't easily buy that, 451Ω is the closest readily available value. For 100:1 the ideal value would be 4950Ω, the closest readily available value is 4990Ω. \$\endgroup\$ Jun 5 at 17:13
  • 1
    \$\begingroup\$ A 170MHz square wave 3rd harmonic is at 510MHz, well above the scope bandwidth (200MHz). The scope acts as a low-pass filter that cuts every harmonic at such fundamental frequency. The waveform has to be a (somewhat distorted) sine wave, regardless of other probing issues. \$\endgroup\$ Jun 6 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.