Yet another scope question: DS1054Z + 45MHz SPI - Page 1
Forum section: electronics / testgear

author: sleziak
author_rank: Newbie
timestamp: September 10, 2015, 04:34:57 pm
content: Hi, newcomer here! I've been a Dave's fan for years now, I'm really thankful for all the knowledge he has passed onto usRecently I've started building quite a complicated system that incorporates 45Mhz SPI communication between two microcontrollers for WiFi together with a RGB display driver and SDIO.Everything worked fine until I entered the 20 MHz+ domain. Packets got lost, hard faults occurred, bits got shifted and without a decent scope I am unable to continue with the projectI was planning to do the following; Purchase a Rigol DS1054Z, "upgrade" it to 100MHz and debug the system, especially the 45 MHz busMy question here is: would a DS1054Z @ 100Mhz be adequate for my requirements?Regards, Marcin

author: Howardlong
author_rank: Super Contributor
timestamp: September 10, 2015, 04:55:32 pm
content: I'd say that while it might help, I can't really recommended it. Although Nyquist says yes from a sampling rate perspective, it will be marginal and the capacitance of the stock probes will start to be quite significant: they will certainly load your circuit.Note that the sampling rate drops to 250MHz with three or four channels, which you'll probably be using with SPI.If you're already experiencing signal integrity problems anyway at 45MHz, a DS1054Z solution might well not give you enough information to resolve it as well as significantly affecting your timing due to probe loading.Having said all that, a DS1054Z is certainly be better than no scope at all. If you can accept its limitations and work around them you might find it good enough with a bit of understanding of its limitations and perhaps with some creative probing.I do accept though that ramping up to a 200MHz or higher bandwidth DSO with a reasonably high sampling rate is a significant step up.

author: Fungus
author_rank: Super Contributor
timestamp: September 10, 2015, 05:15:13 pm
content: Quote from: sleziak on September 10, 2015, 04:34:57 pmNo.A square wave at 45MHz is really a 45MHz sine wave with layered sine wave harmonics at 135Mhz, 225MHz, ....etc.On a 'scope with 100MHz bandwidth you'll only be able to see the 45MHz sine wave clearly. Even the 135Mhz harmonic will be greatly attenuated.Result: You won't be able to tell much about the signal edges, signal rise times, etc. - which is important for debugging this.I'd say you needat least200MHz bandwidth to see if the signal is reasonably clean or not. Even so it won't be the precise square wave you're expecting to see, it will be like the third waveform in this image (actually slightly worse because 225MHz doesn'tquitefit in there):

author: marshallh
author_rank: Unknown
timestamp: September 10, 2015, 05:24:23 pm
content: The scope will just tell you "your SI sucks". So, fix the issue by making a proper pcb, return paths for every signal, source termination, etc. You can still use the scope to make sure SPI looks like it should, but you wont get the full picture.

author: Karel
author_rank: Super Contributor
timestamp: September 10, 2015, 05:29:05 pm
content: When measuring digital signals like SPI, as a rule of thumb, the analog bandwidth of the oscilloscope,including the probe, must be at least 10 times the bitrate of the signal of interest.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 10, 2015, 05:32:21 pm
content: Quote from: sleziak on September 10, 2015, 04:34:57 pmto look at decent 45MHz clocked square wave, i'd say 10x of it, get a 450MHz scope...

author: sleziak
author_rank: Newbie
timestamp: September 10, 2015, 05:33:45 pm
content: @Howardlong, Fungus, Karel and MechatrommerThank you for your replies, I was afraid that the bandwidth won't be enough to get any useful information at those frequencies. But I do have to agree that any scope is better than no scope, I'm ordering the rigol soon.@marshallh, you are 100% correct, it's surprising that I get any SPI data with the current hardware setup. The first prototype PCBs will come once I overcome some software quirks and make up my mind on the WiFi chipset. There is so many possible problems with the way I am handling the current communication, one of the issues is that some data packets inherit bits from previous packets ie: a string of "10101010" bits becomes "01010101" which might indicate interrupt problems or SCK synchronization issues. Once I get the scope I hope that I will be able to do some basic debugging like this in order to rule out software issues.All your input is greatly appreciated!

author: Fungus
author_rank: Super Contributor
timestamp: September 10, 2015, 05:34:08 pm
content: Quote from: marshallh on September 10, 2015, 05:24:23 pm("Signal Integrity")Yes, the DS1054Z will let you see any major faults and tell you if it's a complete trainwreck. That *might* be enough to get it working even if it still doesn't have perfect signalsThere's no guarantees though. A 200+MHz 'scope is a safer bet.nb. 200MHz is theminimumI'd consider for this - square waves have infinite bandwidth! (unlike our hardware budgets). The important thing is to know what you're looking at. Keep the harmonics thing in mind whenever you look at square waves on a 'scope (or any other signal that isn't a sine wave!).

author: CatalinaWOW
author_rank: Super Contributor
timestamp: September 10, 2015, 05:52:55 pm
content: Quote from: Fungus on September 10, 2015, 05:34:08 pmSquare waves have infinite bandwidth. Which is why they don't exist in real life. The trick with SI is get signals that cleanly and repeatably cross the detection thresholds in your system. The higher bandwidth you can observe with, the more likely you will be able to find any culprits that leave ledges, dips and other gremlins around the threshold. But there is never any benefit to having significantly (say a factor of two to four) more observation bandwidth than the limiting bandwidth in your system. And that is where the fun is. That limiting bandwidth is seldom known or understood, unless specifically designed in.

author: tggzzz
author_rank: Super Contributor
timestamp: September 10, 2015, 06:02:32 pm
content: Since you state that the problem depends on the "frequency" of the SPI bus, I would guess you have a signal integrity (SI) problem. Assuming that's the case...The SI problem will manifest itself on theedgesof digital signals, in the form of ringing, undershoots and overshoots. Those will be constant whatever the bit/baud rate, but if the bit/baud rate is slow enough the transients will have died out before the data is "sampled" by the receiving flip flop.If you don't have a scope then, looking at your picture (thanks!), I would suggest you take standard precautions to preserve signal fidelity. Principally they are: terminate long lines with the appropriate resistors, ensure there is a ground path near each signal path (especially between boards), use twisted pairs between boards, ensure there are sufficient grounds and decoupling that ground bounce isn't an issue. Those are all absolutely standard precautions which can be found in many many publications.Note that even with a "fast enough" scope, poor probe grounds will introduce transient problems. Seehttps://entertaininghacks.wordpress.com/2015/04/23/scope-probe-accessory-improves-signal-fidelity/andhttps://entertaininghacks.wordpress.com/library-2/scope-probe-reference-material/for more information.

author: Howardlong
author_rank: Super Contributor
timestamp: September 10, 2015, 09:52:51 pm
content: Quick note: back in the 70s I used to fairly easily debug 4MHz Z80 busses including dynamic memory interfaces with RAS and CAS strobes down to 10ns or 20ns time difference resolution with 10MHz analogue scopes, which is roughly equivalent to the OP's requirement, plus, being a DSO, the OP has the benefit of single shot.It was all about accepting and understanding your tool's limitations, and working with that.What I'd have given for one shot capability in those days.Edit to say: I am not recommending it, just that a DS1054z is better than no scope at all, and tggzzz is correct that creative probing (as I mentioned in my first response) is key.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 11, 2015, 05:25:01 am
content: "square wave" infinite freq is theoritical term, in reality, our square waves have limited/finite freq harmonics, RLC will dampen the theoritical nature of it, hence that depends on risetime capability of a generator. so as someone puts, you need to observe the "risetime", 10X sampling and BW during the "risetime period only" is much preferable but that can be a premium. thats why they called 1054z series a "hobbiest scope", 1GSps only able to recontruct at decent 100MHz (with its ringing and overshoot) or 10ns of risetime give or take. at 450MHz @ ~2ns of risetime it can only capture 2 points, and not much you can see SI wise with that even if the scope BW permits. i fully agree with tggzz, without proper dso with eye pattern display, you need to take measure in every possible aspects to solve the SI problem, down to the bare metal and pure imagination.

author: tggzzz
author_rank: Super Contributor
timestamp: September 11, 2015, 07:37:44 am
content: Quote from: Mechatrommer on September 11, 2015, 05:25:01 amYes. As I point out to the less experienced, with any digitising scope you should ignore the samples/sec marketing fluff, and concentrate on the analogue bandwidth. One of my favourite scopes was the HP54110, which was a 1GHz 25MS/scope and very good for examining edges that were "40* its sampling frequency" (ahem).

author: rf-loop
author_rank: Super Contributor
timestamp: September 11, 2015, 07:51:45 am
content: Quote from: tggzzz on September 11, 2015, 07:37:44 amAmen.