EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: NivagSwerdna on January 10, 2024, 07:50:00 pm

Title: Newbie Scope: Things that aren't square...
Post by: NivagSwerdna on January 10, 2024, 07:50:00 pm
I have a Rigol DS1052E Oscilloscope labelled 2CH 50MHz/1Gs/s

[attachimg=1]

I attached one channel to a signal which should be a 18MHz square wave and another which is the above divided by 3 so around 6MHz.

Why aren't they squarer?  Is it my measuring or a limitation of the scope?

I can guess a 18MHz and a 6MHz wave (with a 2:3 duty cycle)... but I would have to guess
Title: Re: Newbie Scope: Things that aren't square...
Post by: Ice-Tea on January 10, 2024, 07:54:34 pm
Source of the square?
Title: Re: Newbie Scope: Things that aren't square...
Post by: wasedadoc on January 10, 2024, 07:59:09 pm
The 18MHz trace might be the result of you having unknowingly enabled the 20MHz low pass filter.

As for the other trace I would suspect something amiss with the 6MHz source.

It may be relevant that the fall time of both appears to be the same.
Title: Re: Newbie Scope: Things that aren't square...
Post by: janoc on January 10, 2024, 08:24:16 pm
I have a Rigol DS1052E Oscilloscope labelled 2CH 50MHz/1Gs/s
...
I attached one channel to a signal which should be a 18MHz square wave and another which is the above divided by 3 so around 6MHz.

50MHz scope will not show 18MHz square wave as a square wave but as a more-or-less distorted sine because it doesn't have enough bandwidth. Remember, square wave = fundamental 18MHz + infinite amount of harmonics. You need to get at least ~5 of those harmonics for the signal to still look somewhat square. With 50MHz bandwidth you would have at best 2, third harmonic is already outside.

So that explains your 18MHz signal.

Why the 6MHz signal is so messed up is difficult to say without knowing more about your signal source and how are you measuring things.

Title: Re: Newbie Scope: Things that aren't square...
Post by: T3sl4co1l on January 10, 2024, 09:14:04 pm
Check that the probes are on the x10 setting.

Tim
Title: Re: Newbie Scope: Things that aren't square...
Post by: Benta on January 10, 2024, 09:42:08 pm
I'd say your divider is too slow (74HC?).
But, you know, posting only half the information (the 'scope part) and leaving out the circuit gives you half answers.

Title: Re: Newbie Scope: Things that aren't square...
Post by: srb1954 on January 10, 2024, 09:43:20 pm
Check that the probes are on the x10 setting.
And properly compensated using the calibrator O/P from the scope.
Title: Re: Newbie Scope: Things that aren't square...
Post by: golden_labels on January 10, 2024, 09:44:25 pm
To provide pictures to what janoc explained above: square wave composition (https://commons.wikimedia.org/wiki/File:Synthesis_square.gif) from harmonics. For your 18 MHz square wave, the first four are 18 MHz, 36 MHz, 54 MHz, 72 MHz. As you can see the third one is already beyond scope’s bandwidth.

Paul Falstad created a Fourier transform demo (https://falstad.com/fourier/), which you may use to play with the concept. Buttons on the right set predefined waveforms.

Also note that “square wave” is an idealized concept. Very often they are actually sinusoidal: in particular for clock signals and when data signal is pushed to the limits of the medium. So be sure the signal is expected to be squareish in the first place.



Title: Re: Newbie Scope: Things that aren't square...
Post by: tggzzz on January 11, 2024, 12:04:27 am
Ignore the number of harmonics points; the risetime is all that matters[1] whatever the fundamental frequency. Concentrate on the understanding that a scope is a time domain instrument.

If you have a square wave input, then the rule of thumb is that the scopes risetime is 0.35/BW: a 50MHz scope will have a 7ns risetime. That's true for an 18MHz or 18Hz square wave.

[1] https://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/
Title: Re: Newbie Scope: Things that aren't square...
Post by: pickle9000 on January 11, 2024, 12:08:35 am
When you look at a trace that appears not as expected.

- Check your setup, the act of measuring can alter the waveform (x10 x1 on a probe makes a diffrence)
- Check or perhaps understand your device under test. The quality / uniformity / level vary can greatly over the
frequency range of the device.

This can be a very fun/educational thing. I'd suggest a notebook and pencil. If you are looking at signal generator
try different settings on scope and don't forget x10 x1 on the probe. Characterizing your test gear  is a part of
bench work. 
Title: Re: Newbie Scope: Things that aren't square...
Post by: Vovk_Z on January 11, 2024, 08:30:16 am
So that explains your 18MHz signal.
No, it doesn't. 18 MHz and any signal with two-three harmonics doesn't look like sine or sawtooth. There is something other going wrong (or not).
Title: Re: Newbie Scope: Things that aren't square...
Post by: pcprogrammer on January 11, 2024, 08:52:08 am
Yes many factors to consider.

Measuring on for instance a breadboard with crappy connections can distort the signal due to added resistance and capacitance. Without the schematics and the measurement setup there is no way of telling why you see on the scope what you see.

In the 6MHz signal it looks like the 18MHz is somewhat bleeding through, forming the ripple on the high part of the signal.

Conclusion: Provide us with more information if you want to get better answers.

Title: Re: Newbie Scope: Things that aren't square...
Post by: NivagSwerdna on January 11, 2024, 02:08:39 pm
The signals come from an Arcade PCB... it's not exactly this since my actual board has some different components but essentially it is the same...

The 18MHz is the 401 signal..


[attachimg=1]

The other signal isn't described completely on the schematic but is the equivalent of this diagram...

[attachimg=2]

The green signal

For all intents and purposes the bottom schematic shows both signals but on my board some of the parts are in a custom chip which implements the equivalent.

The pair of JKs form a divide by 3

Title: Re: Newbie Scope: Things that aren't square...
Post by: CaptDon on January 11, 2024, 02:24:03 pm
Be aware, as Tim mentioned, the X1 setting on the probe may have a very low bandwidth. I learned this the hard way with my Tektronix P2220 probes (and all the chinese imitations). These are '200 MHz' probes with a 6 MHz bandwidth in the X1 position!! I surely didn't expect that lower limit on a 200 MHz rated probe!
Title: Re: Newbie Scope: Things that aren't square...
Post by: Ice-Tea on January 11, 2024, 02:24:39 pm
You're leaving a lot of blanks, "some different components" makes all the difference. But TP401 won't have much of a square on it at 18MHz and with a Tr of 10ns or so from that buffer :-)
Title: Re: Newbie Scope: Things that aren't square...
Post by: pdenisowski on January 11, 2024, 02:54:34 pm
If you have a square wave input, then the rule of thumb is that the scopes risetime is 0.35/BW: a 50MHz scope will have a 7ns risetime. That's true for an 18MHz or 18Hz square wave.

Yes, that's very good advice :)

Note however that the factor may need to be increased from 0.35 to around 0.40 depending on the scope's frequency response -- 0.35 is usually for scopes with a Gaussian response, whereas a slightly higher factor might be better for scopes with a "steeper" frequency response (i.e. more "wall-like")

I talk about this in my video on oscilloscope bandwidth:

https://youtu.be/FhT8TpuI7ek?t=621
Title: Re: Newbie Scope: Things that aren't square...
Post by: pcprogrammer on January 11, 2024, 03:24:38 pm
The schematic helps indeed. Both 74LS parts used in the schematic are "slow" when it comes to rise time. The JK filpflop, according to the datasheet I checked, has a typical max clock frequency input of 20MHz, so close to what is used in this design.

The 6MHz signal, like you stated in your original post, comes out as 33% or 66% pulse width depending on which output is measured. On the green marked one it would be high for two clock periods and low for one. This can be seen on your scope image. But there it has a rise time of ~50ns which is indeed quite long even for the 74LS107.

So maybe what others have pointed out is that you are using 1x setting on your probes.
Title: Re: Newbie Scope: Things that aren't square...
Post by: NivagSwerdna on January 11, 2024, 06:05:05 pm
TBH I've never had my probes on anything other than x1.... so the idea to use x10 is quite novel to me!

Anyway...

[attachimg=1]

So that's with the probes at x10 and otherwise default.

It's clearly represents what I would expect from a logical point of view.  i.e. the blue trace is 1/3 of the yellow trace with a 2/3rds duty cycle.

And I take the Fourier comments from a point of view of someone who's done FFTs in the past so that is understood; just thought I was getting short changed from my 50MHz scope which is allegedly tweaked to 100MHz.

FWIW The scope has a Sinx/x setting... didn't seem to make much difference
Title: Re: Newbie Scope: Things that aren't square...
Post by: NivagSwerdna on January 11, 2024, 06:08:12 pm
You're leaving a lot of blanks, "some different components" makes all the difference.
As stated some of the logic on this board is provided by a (Konami) Custom Chip which is not documented.  But logically that device just implements the logic that is found on similar boards... just in one custom package.
Title: Re: Newbie Scope: Things that aren't square...
Post by: MarkT on January 11, 2024, 06:31:37 pm
The whole point of x10 probes is high bandwidth with low loading of the circuit, using the x1 setting is seldom if ever useful due to it heavily loading the circuit (lots of capacitance) and having low bandwidth (typically 1/10th of the probe's x10 bandwidth).
Title: Re: Newbie Scope: Things that aren't square...
Post by: tggzzz on January 11, 2024, 08:16:16 pm
TBH I've never had my probes on anything other than x1.... so the idea to use x10 is quite novel to me!

Anyway...

(Attachment Link)

So that's with the probes at x10 and otherwise default.

It's clearly represents what I would expect from a logical point of view.  i.e. the blue trace is 1/3 of the yellow trace with a 2/3rds duty cycle.

And I take the Fourier comments from a point of view of someone who's done FFTs in the past so that is understood; just thought I was getting short changed from my 50MHz scope which is allegedly tweaked to 100MHz.

FWIW The scope has a Sinx/x setting... didn't seem to make much difference

Top trace shows a clean risetime of approx 7ns, which corresponds to a 50MHz response - as expected. That signal has sufficient signal integrity to be usable as a clock.

Bottom trace also has a clean 7ns falltime, but there is a lot of crap. It could not be used as a clock.

What could cause the crap? One obvious possibility is a poor probe ground connection. Make sure you have a short connection between the probe's shield and the ground on the IC driving the bottom trace.
Title: Re: Newbie Scope: Things that aren't square...
Post by: JustMeHere on January 12, 2024, 03:51:21 am
On some of your screenshots you have channel 1 in AC mode.
Title: Re: Newbie Scope: Things that aren't square...
Post by: wasedadoc on January 12, 2024, 09:30:25 am
On some of your screenshots you have channel 1 in AC mode.
So what?
Title: Re: Newbie Scope: Things that aren't square...
Post by: Vovk_Z on January 12, 2024, 04:56:42 pm
TBH I've never had my probes on anything other than x1.... so the idea to use x10 is quite novel to me!
The rule is always use x10 divider except some rare cases when you really need x1. Only x10 divider has the smallest possible influence on the circuit and the signal you want to look at.
Using x1 instead of x10 is an old known catch for a young players.
Title: Re: Newbie Scope: Things that aren't square...
Post by: shapirus on January 12, 2024, 05:02:14 pm
Someone in a related topic gave an advice of switching your probes to x10 and wrapping the switches over with insulation tape to make them stay in that position, and that's a good advice.
I would only add that it's better to use a heat shrink tube for this: it looks better and does not leave a sticky residue.
Title: Re: Newbie Scope: Things that aren't square...
Post by: tooki on January 13, 2024, 11:50:40 am
Someone in a related topic gave an advice of switching your probes to x10 and wrapping the switches over with insulation tape to make them stay in that position, and that's a good advice.
I would only add that it's better to use a heat shrink tube for this: it looks better and does not leave a sticky residue.
Yep. Or just replace them with fixed x10 probes! (For example, the basic x10 probes from Testec only cost about €15 and are way nicer than Rigol’s probes.)
Title: Re: Newbie Scope: Things that aren't square...
Post by: PA0PBZ on January 13, 2024, 02:09:54 pm
It's a rainy Saturday here so I created your circuit and measured twice: 500MHz bandwidth and 20MHz bandwidth, see pictures and note the difference.
I didn't have (didn't want to search too long) a 18MHz crystal so I used a 16MHz one, shouldn't matter.

500MHz:

(https://www.eevblog.com/forum/beginners/newbie-scope-things-that-arent-square/?action=dlattach;attach=1980076;image)

20MHz:

(https://www.eevblog.com/forum/beginners/newbie-scope-things-that-arent-square/?action=dlattach;attach=1980082;image)
Title: Re: Newbie Scope: Things that aren't square...
Post by: NivagSwerdna on January 14, 2024, 09:12:21 pm
Very nice.

Comparing those with my pictures from post#17...


https://www.rigol-uk.co.uk/product/rigol-ds1052e-50mhz-digital-oscilloscope/ (https://www.rigol-uk.co.uk/product/rigol-ds1052e-50mhz-digital-oscilloscope/)

So my scope is allegedly

50MHz

and it was 'tweaked' with some firmware hack to be '100MHz'...

I would have thought my pictures would look better?

Title: Re: Newbie Scope: Things that aren't square...
Post by: tggzzz on January 14, 2024, 09:18:19 pm
If you can see  a 3.5ns risetime, then it is 100MHz.

If you can see a 7ns risetime, then either it is 50MHz or you are seeing the signal's risetime.
Title: Re: Newbie Scope: Things that aren't square...
Post by: ebastler on January 14, 2024, 10:05:05 pm
Someone in a related topic gave an advice of switching your probes to x10 and wrapping the switches over with insulation tape to make them stay in that position, and that's a good advice.
I would only add that it's better to use a heat shrink tube for this: it looks better and does not leave a sticky residue.

Yet another way to implement this: On many low-cost probes (including the ones from Rigol which I have), you can simply pop out the little "grip" piece of the slide switch. That leaves you with a nicely recessed switch which can still be moved to 1x with a small screwdriver in the rare situations where you need that -- but otherwise can't be moved inadvertently.
Title: Re: Newbie Scope: Things that aren't square...
Post by: IDEngineer on January 15, 2024, 04:08:52 pm
I suspect you have a (probe) connection issue at work too. I believe I can see your top, yellow trace riding on what looks to be a sine-ish lower frequency. I'd double check your physical connections. Can't accurately diagnose a signal until you're sure it's ONLY that signal you're looking at!