Square Wave From Signal Generator on Rigol MSO1104 Not Square - Page 1
Forum section: electronics / beginners

author: SewingYard
author_rank: Contributor
timestamp: April 19, 2016, 08:48:50 pm
content: Hi,Another newbie question that I'd love to know where I'm going wrong.I have my scope setup with a BNC from the signal generator, the sig gen is set to a Square Wave at 15MHz at 5vIt goes straight to the scope probe that's connected to CH1 set to x10 with DC coupling at 2v and 10nsThe problem is the wave looks more like a dodgy sine wave than a square wave, the lower the frequency I go for the more it looks like a true square wave.I always thought a signal gen connected straight to the scope would create a perfect wave, is this still true even at higher frequencies or does the resistance / capacitance of the probe get in the way?Thanks.

author: ez24
author_rank: Super Contributor
timestamp: April 19, 2016, 08:53:31 pm
content: As a follow-up question. Is there really such a thing as a square wave?to OP - I think you will get better answers if you post a picture. I know there is no perfect square wave.

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 19, 2016, 09:04:27 pm
content: I have similar results as the OP with my 15Mhz Agilent 33120A.The reason for that is the minimum signal rise time.Meaning that the signal can simply not rise fast enough for you to see a square wave at 15Mhz.If you for example set the frequency from 15Mhz to 100kHz but don't change the time scale on the scope, you'll see that the rising edge should look the same, the thing is that at 15Mhz you're zooming enough to notice it.Check the specs on your signal generator, what's the rise time ?Also what scope are you using ?

author: LazyJack
author_rank: Frequent Contributor
timestamp: April 19, 2016, 09:08:38 pm
content: Check for proper termination. Sig gen outputs are usually 50ohm and the coax should be terminated at the scope end. If the scope had 50 ohm input mode use that, or use 50 ohm feedthrough terminator.This will do magic with fast rise signals.

author: Howardlong
author_rank: Super Contributor
timestamp: April 19, 2016, 09:19:04 pm
content: Michaelv is right, rise time on the signal generator is 15ns. This is what I see on an MSO1074Z-S (liberated).Edit: I did try it with an inline terminator at the time of the test too, the signal actually looked slightly worse!

author: SewingYard
author_rank: Contributor
timestamp: April 19, 2016, 09:24:36 pm
content: Hi,Thanks for the sanity check everyone.I have done a screenshot of my scope, I have used both channels of the signal generator, one of the channels is using a BNC cable with mini-grabbers (yellow) and one channel is using a scope probe set to x1 (blue)The results seem wildly different, I'm assuming you really shouldn't use a scope probe for the sig gen at higher frequencies?michaeliv, the scope I'm on is a Rigol MSO1104Z-S, im using the built in Signal Generator.

author: dnwheeler
author_rank: Regular Contributor
timestamp: April 19, 2016, 09:26:54 pm
content: Quote from: ez24 on April 19, 2016, 08:53:31 pmMany people will tell you that if you combine an infinite number of sine waves you can get a square wave, but this has been proven to be incorrect. There's a good discussion on Quora:https://www.quora.com/Can-we-in-practice-exactly-reconstruct-a-square-wave-by-summing-up-sinusoidal-components.Of course, a signal generator doesn't do this anyway. It just turns a signal on and off at a certain rate.

author: Howardlong
author_rank: Super Contributor
timestamp: April 19, 2016, 09:30:00 pm
content: Quote from: SewingYard on April 19, 2016, 09:24:36 pmDid you compensate the probe?

author: SewingYard
author_rank: Contributor
timestamp: April 19, 2016, 09:42:47 pm
content: Howard, I've tried adjusting the compensation pot on the probe and it doesn't do a great deal because the probe that's plugged into the Signal Generator on the Blue wave is set to x1I think you are right with the rise time on the sig gen being 15ns meaning that its going to look tapered at the edges at higher frequencies.

author: Matje
author_rank: Regular Contributor
timestamp: April 19, 2016, 09:52:32 pm
content: Quote from: SewingYard on April 19, 2016, 09:24:36 pmYou just learned to not use a scope probe at 1x for high frequency signals. Check the probes documentation, it will tell you that at 1x the bandwidth is quite low compared to 10x. I have an example here where at 10x the bandwidth is supposedly more than 100 MHz while at 1x that drops to 5 MHz (!).As others mentioned proper 50 Ohms impedance throughout, i.e. no clips, mini-grabbers or stuff, just 50 Ohms coax with 50 Ohms connectors and a 50 Ohms termination at the scope end might help (the screenshot doesn't look like that's a problem here though).And for a 15 MHz square wave you kinda sorta need about 150 MHz analog bandwidth and about 1.5 GSa/s, otherwise even a very good signal will start to look deformed.

author: tggzzz
author_rank: Super Contributor
timestamp: April 19, 2016, 10:05:37 pm
content: Quote from: Matje on April 19, 2016, 09:52:32 pmYour other points about the probes are correct, but those points are far too simplistic.The scope bandwidth you need iscompletelyunrelated to a square wave's frequency; it dependsonlyon the risetime/falltime. The traditional rule of thumb is tr=0.35/BW. Simple thought: when looking at one transition, the scope neither knows nor cares when the next transition will come along.Secondly, the relationship between samples/s and bandwidth is also too simplistic. Many scopes have an "ETS" mode where the sample rate is muchlessthan the signals' bandwidth; many years ago I used a 25MS/s to observe sub-nanosecond risetimes. First google result for a contemporary scope:https://www.picotech.com/library/oscilloscopes/equivalent-time-sampling

author: Matje
author_rank: Regular Contributor
timestamp: April 19, 2016, 10:38:23 pm
content: Quote from: tggzzz on April 19, 2016, 10:05:37 pmOK, granted, I guess that's why it's called "rule of thumb" ;-)Of course I assume a square wave has "reasonably" (for some definition of that) steep edges, needing about enough bandwidth for the 7th to 9th harmonic to show a reasonable (...) image of the signal. Since there is a relation between maximum possible rise/fall time and base frequency of a square wave the base frequency also sets the lowest allowable bandwidth limit.As for ETS mode, hmm, I think that's largely a (historical) kludge, although if properly implemented it should work for suitable signals. IOW - usually not.You just can't observe a not strictly repetitive (over many periods of the timebase) signal using ETS. And if you already know that much about the signal there are only a few things left to find out about it by using a scope.For anything non-repetitive, glitchy, not-quite-known-in-advance there is no way around having enough bandwidth and sample rate to capture the actual signal - at first go.

author: tggzzz
author_rank: Super Contributor
timestamp: April 20, 2016, 12:56:00 am
content: Quote from: Matje on April 19, 2016, 10:38:23 pmThe second sentence is wrong, pure and simple: the transition time is independent of the period. As for the first sentence...Er, no. Let me guess. Your background is either theoretical or audio or software; you don't appear to have used a scope for looking at medium speed logic signals (medium speed = any logic family introduced since 1980)Very few people look at square waves; the primary place you find them is in textbooks, especially associated with introductory Fourier analysis.Most people look at logic signals. There the key factors are signal integrity and logic value. Signal integrity requires ensuring the transition time does not violate the specs in the logic families' data sheet (valid voltages at all times, and minimum slew rate, and minimum pulse widths).It doesn't matter if your signal transitions once per microsecond or once per year: you still need to have suitably fast edge rates. The device I was using today (a 74LVC1G14) specifies tr<=2.5ns.It doesn't matter if your clock rate is 1MHz or 1mHz. If there is a runt pulse of a couple of nanoseconds then it can misclock or fail setup/hold times.You would benefit fromunderstandingBogotin's rules of thumbhttp://www.edn.com/collections/4435129/3/Bogatin-s-Rules-of-Thumbespecially rule 0.QuoteNo. I explicitly referred to a contemporary scope.Of course, if you have excessive amount of money then you can very fast sampling rates. But engineering is learning how to use your tools and - to repeat the old aphorism - do for $1 what any fool can do for $10.QuoteIf only things were that simple.Repetitiveorpseudo-repetitive signals are required. Often signals can be arranged to be repetitive. If not then you can still get important information from pseudo repetitive signals. For example, eye diagrams are also a current technique that won't disappear soon - especially with bit rates >1Gb/s.QuoteIt certainly helps, but eventually you will run into circumstances where that isn't sufficient; at that point you have to become more creative in how you use your tools. You might as well use the same techniques at other times.

author: Matje
author_rank: Regular Contributor
timestamp: April 20, 2016, 10:33:51 pm
content: Quote from: tggzzz on April 20, 2016, 12:56:00 amNot really. What I meant is the following: the sum of rise and fall time can't be larger than the period of the square wave. At the limit it will already be a triangle or sawtooth.Quote from: tggzzz on April 20, 2016, 12:56:00 amWhat I currently do to earn money is software. What I got an education in - way back when - is electronics. So there. ;-)Quote from: tggzzz on April 20, 2016, 12:56:00 amEverybody knows that strictly speaking a square wave is a mathematical abstraction not existing in the real world. At least people should know.That doesn't dissuade anybody from talking about square waves in the real, physical world if the signal in question is close enough to the mathematical ideal.[...]QuoteQuote from: tggzzz on April 20, 2016, 12:56:00 amOK, but as far as i'm aware not that many people actually deal with that kind of bitrates (not even in a professional context), and I didn't mean to talk about measuring that kind of high speed signals.Certainly the OP didn't talk about Gbps signals either, so information about measuring these is unlikely to be helpful to him, at least in the short/medium term.[...]

author: tggzzz
author_rank: Super Contributor
timestamp: April 20, 2016, 11:00:55 pm
content: Quote from: Matje on April 20, 2016, 10:33:51 pmYou might be surprised. Surprisingly little has changed in the past 2 or three decades, except for things becoming smaller, faster, cheaper. But nowadays even run-of-the mill logic and FPGAs are multi-gigabit/s per pin, and the aggregate bandwidth is stunning.Two areas that have changed significantly are nanopower devices/systems, and the sampling rate of digitisers/scopes. Are you aware that you can buy a 160GS/s scope? (I looked last year; there may be faster machines available this year.QuoteThe principles and misapprehensions are the same at any speed.

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 21, 2016, 01:08:27 am
content: Quote from: tggzzz on April 20, 2016, 11:00:55 pmMy bank account would like to respectfully disagree with you.

author: tggzzz
author_rank: Super Contributor
timestamp: April 21, 2016, 07:38:06 am
content: Quote from: michaeliv on April 21, 2016, 01:08:27 amThat's what bank loans are for

author: tautech
author_rank: Super Contributor
timestamp: April 21, 2016, 07:54:41 am
content: For the OP, here's a thread on square waves from last year:https://www.eevblog.com/forum/testgear/show-us-your-square-wave/

author: MrSlack
author_rank: Frequent Contributor
timestamp: April 21, 2016, 08:41:40 am
content: As a quick optimisation hack: If you have a crappy pulse gen or function generator, you can improve the rise time by piping the output via a few gates in parallel from a 74AC14 schmitt inverter array properly terminated close to the scope. 1-2ns edges on them. That looks more like the real fourier series output for a square (is there such a thing?) wave as well: ringing. This trick has been around since the dark ages.I await the day I find a cheap Tek 7000 1GHz mainframe...

author: tggzzz
author_rank: Super Contributor
timestamp: April 21, 2016, 08:59:18 am
content: Quote from: MrSlack on April 21, 2016, 08:41:40 amPersonally I use 3*(74LVC1G14+130ohms) in parallel. On my Tek485 (350MHz nominally, but surprisingly good to 600MHz) I can see ~900ns risetimes. Indirect measurements of the spectrum lead me to believe the risetime is nearer 600ps.

author: MrSlack
author_rank: Frequent Contributor
timestamp: April 21, 2016, 09:10:43 am
content: That's a fast edge! I'm maxed out on a 465B at 100MHz and I can measure ~1.5ns off an 74AC14. I would love to use 74LVC1G14 but I can't see the damn things

author: tggzzz
author_rank: Super Contributor
timestamp: April 21, 2016, 11:39:39 am
content: Quote from: MrSlack on April 21, 2016, 09:10:43 amThat's what head-mounted visors are forHere are some oscillograms with my 485.The reference is the 485's own cal out, which is a respectable ~1ns risetime although only 500mVpp.The 3*(74LVC1G14 + 130ohms) is the most repeatable result, with ~900ps risetime and a moderate overshoot.The 3*74LVC1G14 driving 50 ohms is pretty respectable too (and twice the amplitude). OTOH, when driving a scope input 1Mohm // 20pF the results merely show why signal integrity is an important topic.Using a 1.5GHz low-impedance Z0 probe, an HP10020a with a spear ground, shows pretty respectable results for an ad-hoc connection. The single output is perfectly acceptable, but paralleling three gives too much "oomph"The source of the 500MHz ringing is unclear; I would expect probe resonances to be around 1GHz (<1pF, 25mm=25nH).EDIT: the obvious test is to use the low-impedance probe to observe the 3*(74LVC1G14 + 130ohms) signal output. The two traces are identical within the limits of the match of the two oscilloscope input channels. Conclusion: the ringing is a real artefact, not an artefact of the probe.

author: MrSlack
author_rank: Frequent Contributor
timestamp: April 21, 2016, 12:01:25 pm
content: Cool stuff.Is that 50 ohm termination inside the 485?Quite surprised to see that level of ringing on a Z0 probe with spear. TBH at that level because my crappy old Tek probes taper off at about 70MHz, and I'm too cheap to buy some nice ones, I built my own probe with a bit of quality RG58U and a couple of hand picked resistors and soldered it in circuit. No internal termination on my 465B though. Worked like a dream however

author: tggzzz
author_rank: Super Contributor
timestamp: April 21, 2016, 01:29:29 pm
content: Quote from: MrSlack on April 21, 2016, 12:01:25 pmYes it is, and all the better for itPresumably Tek learned from the HP1740a - and improved on it by disconnecting the 50ohms in the event of an overload.QuoteSo am I. I think the 3*CMOS may be partially due to a longer track (<2cm) than desirable. Maybe I'll chop the track and see if it makes a difference. The other possibility is that a 100nF 0603 for each gate isn't sufficient decoupling.OTOH, there's no such issue with the 1*CMOS, and the ringing is still there at the same frequency, albeit lower amplitude.Hence I suspect it is the CMOS output being agggressive.

author: SewingYard
author_rank: Contributor
timestamp: April 21, 2016, 02:38:38 pm
content: Quote from: tautech on April 21, 2016, 07:54:41 amThanks for this, exactly what I was looking for, plenty of images from other peoples scopes there that shows exactly what I was experiencing.Also, thanks to everyone else, looks like a couple of people had an ahem "interesting" discussion around the thread.Guess my next research for a couple of hours is Fourier Series.

author: tggzzz
author_rank: Super Contributor
timestamp: April 21, 2016, 04:53:57 pm
content: Quote from: tggzzz on April 21, 2016, 01:29:29 pmThe obvious test is to use the low-impedance probe to observe the 3*(74LVC1G14 + 130ohms) signal output. The two traces are identical within the limits of the match of the two oscilloscope input channels. Conclusion: the ringing is a real artefact, not an artefact of the probe.

author: Zero999
author_rank: Super Contributor
timestamp: April 21, 2016, 07:19:48 pm
content: Isn't there a risk of mismatch between the output impedance/propagation delays of the gates which can mess things up? If you're going to parallel them, it should be better if they're all on the same die.

author: tggzzz
author_rank: Super Contributor
timestamp: April 21, 2016, 10:04:48 pm
content: Quote from: Hero999 on April 21, 2016, 07:19:48 pmYes, but I think it is a lesser problem, especially when all the devices are from the same batch. Layout will be at least as intractable issue.Having multiple gates in a package increases power supply lead lengths and consequent ground bounce problems. Don't forget that di/dt is around 100000000A/s (100MA/s), I.e. 100mA in 1ns.

author: Howardlong
author_rank: Super Contributor
timestamp: April 22, 2016, 06:34:25 pm
content: Quote from: tggzzz on April 21, 2016, 01:29:29 pmFWIW. the best I can do with an unterminated output is about 510ps with a single lvc1g14, probed with an Agilent 1130A 1.5GHz single ended FET probe with browser on an MSO7104B.The input is AC coupled and terminated with 100 ohm to Vcc and 100 ohm to GND.I did try a couple of other experiments such as making the output look like a 50 ohm source directly into a 20GHz sampling scope with a single series resistor and AC coupling cap but this made it worse at 670ps. It needs a T or pi match I think.Is that 130 ohm a "sweet spot" for the LVC series? I can see three of them plus the inherent device's output impedances reasonably showing as a 50 ohm source.

author: Howardlong
author_rank: Super Contributor
timestamp: April 23, 2016, 11:26:58 am
content: This is an SN74AUC1G14, again with a 1130A with single ended browser probe + MSO7104B scope, probed directly on the unloaded output pin. (This scope & probe has a measured system rise time of 320ps).I've found that as soon as I load the pin, the rise time deteriorates. A 270 ohm 0603 to ground soldered directly at the chip's lead, for example, increased the rise time to 570ps with the same probe/scope combination. As with the LVC1G14, using the lo-z probes I have for the 20GHz sampling scope again gave a slower rise time than using the 1130A FET probe

author: tggzzz
author_rank: Super Contributor
timestamp: April 23, 2016, 02:46:59 pm
content: Quote from: Howardlong on April 22, 2016, 06:34:25 pmI've increased the decoupling capacitors from 100n to 4u7 0603s. This has reduced, but not eliminated, the switching perturbations on the 5V rail. On my scope 350MHz Tek485 it makes very little difference to the oscillograms, except that the overshoot on the 3*CMOS driving 50oms is reduced. That suggests the CMOS outputs are being aggressive.QuoteAh, the joys of having more than obsolete hobby equipmentI've made indirect measurements of the transition time by driving the 3*(LVC14+130ohms) from an AC coupled noise source and looking at the result on a spectrum analyser (an SDR dongle, since my Tek492 isn't immediately available). Eyeballing the transition between the 20dB/decade and 40dB/decade rolloff indicates a transition time of around 600ps, which isn't too far from your results.QuoteThat's the intention, but quite frankly I don't have a means of validating it. Hopefully the 130ohms will not only reduce ground bounce and decoupling effects, but also reduce the effect the gate's output impedance changing with output voltage.I've attached a picture of that output stage. Given the equipment available to me and the expected transition times:I think the BNC connector is sufficientthere's no real attempt to get the PCB track to be 50ohms; I suspect it is around 75ohmsIf I re-spin the 2 layer 1.2mm board, I might change that plus make the 5V rail into a more complete plane.

author: Howardlong
author_rank: Super Contributor
timestamp: April 24, 2016, 09:05:25 am
content: The decoupling cap I used was a 10nF 0402 directly on the Vcc pin to the groundplane, you can just see it if you zoom the photo.

author: tggzzz
author_rank: Super Contributor
timestamp: April 29, 2016, 06:50:49 pm
content: I added 100nF 0603 directly across the top of each gate. It noticably reduced the PSU perturbations, but otherwise the signals were unaffected when measured with my much slower scope.