1
\$\begingroup\$

I have a small problem trying to make a 16 MHz signal with a scope with 100 MHz 1 GS/s. I can't seem to be able to read the square wave from the MCU clock, see results on the attached picture.

I calibrated the probe with the 1 kHz built in square wave on the oscilloscope.

Also, I can see that if I output the clock signal with a prescaler of 5, i.e. a frequent of 3.2MHz then I am able to read a signal that looks more like a square signal.

I'm not sure what I might be missing or doing wrong.

I'm using the STM Nucleo F410RB development board.

measured signal in oscilloscope

\$\endgroup\$
  • \$\begingroup\$ Please edit your question to show a schematic of what and where you are measuring. If you attach a probe to a crystal oscillator the scope probe capacitance will probably load it and change its frequency or stop it completely. \$\endgroup\$ – Transistor Aug 9 at 1:12
  • \$\begingroup\$ Search the scope manual for "counter" \$\endgroup\$ – sstobbe Aug 9 at 2:18
  • \$\begingroup\$ That looks exactly how a 16 MHz square wave would look like, when there is no impedance matching and is probed with the long ground clip that can't handle the bandwidth required due to stray inductance. If the signal is a 3.3V square wave, then probe is set to 10x but scope is set to 1x so the reported amplitude is wrong by a factor of 10 too. Visually, the frequency seems to be close to 16 MHz as there are 4 periods in 250ns. What accuracy you expect to see, better frequency measurement or better waveform? \$\endgroup\$ – Justme Aug 9 at 7:14
  • \$\begingroup\$ What I expected to read was a better waveform. \$\endgroup\$ – Moisés Pacheco Gendrop Aug 9 at 9:57
3
\$\begingroup\$

The shape of the waveform won't affect the fundamental frequency of a signal. However an oscilloscope is usually not the correct instrument to accurately measure frequency. It may only have an accuracy of 1% or so.

As @glen_geek points out in his answer some oscilloscopes do have counter/timers built into the instrument that can give high-accuracy (typically only for a single chanell) but the frequency displayed using the normal measurement facilities are usually only obtained after the signal is sampled and so will not be as accurate.

If you want to measure the frequency accurately and your scope does not have a built-in frequency counter you will need a frequency counter/timer such as [Keysight 53230A 350 MHz Universal Frequency Counter1

The wave shape distortion you see is almost certainly because of your probing technique. The probe should have an extremely short ground - a couple of inches is too long. Your oscilloscope probe accessories will probably contain some small springs that are used for this purpose.

enter image description here

To get the best waveform I don't use a probe and instead use coax wired directly to the signal. with very short connections.

If the source cannot drive a coax cable directly a 470 or 910 ohm resistor at the probe point can make an ad-hoc 10:1 or 20:1 attenuator with very good frequency response (up to a few GHz). Set the oscilloscope to 50 ohm input impedance if using this approach.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ "The shape of the waveform won't affect the frequency of a signal." You probably mean the fundamental frequency. The shape of the waveform in time domain obviously affects also the frequency domain of the signal. I thought this might be a little misleading, especially as a first sentence of the answer. \$\endgroup\$ – Lars Hankeln Aug 9 at 5:26
  • \$\begingroup\$ Thank you all for the helpful information. I changed the tip to the one suggested, as I was using the sprung hook, reduced the length of the jumper wires and now I get a much better waveform. \$\endgroup\$ – Moisés Pacheco Gendrop Aug 9 at 10:20
  • \$\begingroup\$ "an oscilloscope is not the correct instrument to accurately measure frequency. It may only have an accuracy of 1% or so" - Are you sure? The user manual of the entry-level Rigol DS1054Z mentions <25ppm accuracy for the time base. Of course the accuracy of the frequency counter depends how it is implemented (how many samples it considers, etc), and I found no claims for it in the user guide. But this article claims it observed <2ppm in practice. 1-2% sounds very pessimistic to me. \$\endgroup\$ – marcelm Aug 9 at 12:32
  • \$\begingroup\$ @marcelm - agreed if there is an internal frequency counter available that can give high-accuracy. Often the measurement in the scope will be derived from the sampled signal and so is subject to the sampling limitations and how many cycles are displayed across the screen. Depending upon the settings I've seen errors of worse than 1% even if the timebase accuracy if very good. \$\endgroup\$ – Kevin White Aug 9 at 17:15
0
\$\begingroup\$

Your oscilloscope photo indicates that you are able to measure the MCU clock at 16 MHz quite nicely.

You should be using a "10X" probe. It will add some capacitance to the MCU oscillator, which will likely shift its frequency lower. If the MCU oscillator has an input pin and an output pin, probe the output pin.

Your OWON oscilloscope has a time-base accuracy of \$\pm100\$ parts-per-million. If you need more accuracy, measure frequency with a frequency counter instead...a decent frequency counter should contain a more accurate time base.

Your OWON 'scope has an internal counter claiming 6-digit resolution. If this internal counter uses the main timebase (having accuracy of 0.01%) then its least-significant digits are suspect.


From the OWON SDS1102 manual:

Counter:
It is a 6-digit single-channel counter. The counter can only measure the frequency of the triggering channel. The frequency range is from 2Hz to the full bandwidth. Only if the measured channel is in Edge mode of Single trigger type, the counter can be enabled. The counter is displayed at the bottom of the screen. Operation steps:

  • 1.Push Trigger Menu button, set the trigger type to Single, set the trigger mode to Edge, select the signal source.
  • 2.Push the Acquire button to show the right menu.
  • 3.Select Counter as ON or OFF in the right menu.
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ How does this affect impedance mismatch of false ringing of signal waveform? \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Aug 9 at 15:49
0
\$\begingroup\$

@KevinWhite has given the correct solution.

Analysis. The underdamped square wave indicates peaks every 2/5 in 1cm at 50ns per cm=division approx. thus 40ns cycle = 25MHz resonance. This is common with long ground lead inductance 0.5~1nH/mm and special coax used in 10:1 probe < 90pF/m. The computed resonance is dependant on the length of the ground lead inductance. Thus to expect an increase in resonant frequency requires better impedance matching of the probe 10RC+L : 1RC ratio by reducing the L value. This raises resonant frequency by inverse square root (LC), so to raise 25MHz to 200Mhz 1:8 requires reducing the ground lead length by a factor of 64 down to ~5~10mm from (est. = ) 160~320mm supply or ground lead length including probe ground path length on cct board gnd location. So I predict your probe ground lead was too long and also calibration imperfect.

Conclusion: use ground pad or test points directly at IC. Ensure Vdd,Vss is decoupled by at least 10nF directly at IC. As these also add path inductance to Zout.

Also consider CMOS output impedance ~ 50 Ohm +/-50% from RdsOn is also mismatched and further improvement can be made by examining all stray loads of breadboard wiring to output. (L,C)

P.s. 25MHz probe resonance is pretty common and this is another reason why all DSO’s have 20MHz LPF with amateur 10:1 probes.

| improve this answer | |
\$\endgroup\$

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.