Scope that can decode USB - Page 1
Forum section: electronics / testgear

author: Titan 4380
author_rank: Contributor
timestamp: August 24, 2017, 06:38:40 am
content: Can anybody suggest a modestly priced scope that can decode USB?

author: BravoV
author_rank: Super Contributor
timestamp: August 24, 2017, 06:49:54 am
content: Define "modestly priced" in number.

author: Titan 4380
author_rank: Contributor
timestamp: August 24, 2017, 06:55:20 am
content: Sub$3500 AUD

author: poorchava
author_rank: Super Contributor
timestamp: August 24, 2017, 07:02:06 am
content: Not gonna happen.Even very expensive scopes can only analyze USB from signal integrity standpoint. For analyzing logic issues you need a protocol analyzer.

author: MrW0lf
author_rank: Frequent Contributor
timestamp: August 24, 2017, 07:04:52 am
content: Define "USB"? All you can have a go at with basic gear is USB 1.1 "Full speed" 12Mbps. PicoScope 2408B Arduino<=>PC USB 1.1 traffic decoded:Simplest model I'd recommend is 2206B.Now if need "High speed" 480Mbps then suggest some "modestly priced" 1GHz gearSome old thread about this:https://www.eevblog.com/forum/testgear/mdo3024-vs-msox3024t-usb-2-0-(lsfs)/

author: Titan 4380
author_rank: Contributor
timestamp: August 24, 2017, 07:10:41 am
content: Now its all starting to make sense. I have a DS2302A and I am at a loss to understand why Rigol will option a scope with USB triggers, but no decoders.

author: abraxa
author_rank: Frequent Contributor
timestamp: August 24, 2017, 08:20:41 am
content: Which USB speed are you looking at? 1.1? 2.0? 3.0?

author: Titan 4380
author_rank: Contributor
timestamp: August 24, 2017, 10:40:21 am
content: 2.0

author: darkstar49
author_rank: Frequent Contributor
timestamp: August 24, 2017, 12:28:42 pm
content: Indeed... a scope that can decode USB 2.0 high-speed, i.e. at 480Mbps, requires min 5GS/s sampling rate and typically 1GHz or more bandwidth, something you're not likely to get for under 3500 AUD...You'll get off far cheaper with a USB analyser ! but won't have a scope... obviously !And to put it simply, if your budget is tight... you'll be in trouble anyway... afaik, there are 4 scope makers who offer USB decoding, i.e. R&S, Tek, Lecroy and Keysight... and known 'bypasses' (not) to pay for the decoder licences exist for only 2 of the 4...Don't know what you need... but scope, cheap and USB decoding somehow do not fit very well together... :-P

author: tmbinc
author_rank: Frequent Contributor
timestamp: August 24, 2017, 03:13:55 pm
content: It _really_ depends on what you want to do with it. USB, by design, is a high-latency protocol. That means that with a scope, unless you use very fancy triggers with segmented capture and a _lot_ of sample memory, you will likely not capture enough time to decode to a higher protocol level.USB, without higher-level decodes, is a lot of data to look at (and ignore), especially when there are multiple devices on the bus.If you're after USB2.0 electrical compliance, a scope is probably the right tool, but a simple edge trigger will likely already do enough good.If you're after USB "issues", and you can rule out electrical/PHY problems, then you don't need a scope and a USB protocol analyzer will do a far better job. I have used a few, but I liked the LeCroy the most (probably because I paid the most for them - sigh). YMMV, most of the others are also very good.If you're after the combination, like "My device is randomly crashing after receiving a write command from host", your best bet is to augment your device with trigger outputs (for example, toggle a GPIO in the "write" command handler), and then you don't need USB decoding. If you can't (or don't want to) modify your DUT, use a USB protocol analyzer with trigger output to trigger a scope - most of the USB PAs can have really complex triggers that for most scenarios are flexible enough to trigger at a useful point.The one thing where a USB decoder in the scope is really nice is when you want to learn about USB, which I feel works best by looking at the raw USB packets on the wire at least once. But that you can equally do with USB1.1.

author: jjoonathan
author_rank: Frequent Contributor
timestamp: August 24, 2017, 03:29:54 pm
content: > a scope that can decode USB 2.0 high-speed, i.e. at 480Mbps, requires min 5GS/s sampling rate and typically 1GHz or more bandwidthWhy 2x bitrate of BW? Is it something physical or just price grading?I remember making a notebook in signals class that put square-ish pseudorandom bits through a variable lowpass filter and then plotted an eye diagram. The eye was fully open at BW = bitrate (albeit with completely rounded edges) and smoothly transitioned to fully closed at BW = 1/2 bitrate. Since that factor of 2 translates to many $$$ of scope, I'd like to understand the discrepancy.

author: John_ITIC
author_rank: Frequent Contributor
timestamp: August 24, 2017, 08:49:52 pm
content: Like others have stated: there are two aspects to analyzing USB signalling:1) Analog: You'll need an oscilloscope with capabilities to create eye diagrams. Since there is no separate clock signal in USB 2.0 that can be used to trigger an Equivalent-time oscilloscope, you need to buy a real-time DSO scope that has built-in eye-diagram software for USB 2.0 (HS). The eye diagram will tell you whether the signal has sufficient amplitude and correct bit width at the receiver side but will not tell you whether the actual packets are correct or whether the higher-level protocol makes sense (for that, go to step 2 below).2) Digital: USB Protocol Analyzers contain analog to digital PHY chips that allows the packets exchanged to be stored in memory, uploaded to a PC and displayed in rather complex software. Some USB protocol analyzers simply decode and display packet content in a flat list (makes it very hard to understand the higher-level protocol) while others re-create the actual protocol hierarchy (packets, transactions etc) based in in-depth knowledge of the USB protocol.So, the question is whether you have any reason to doubt the signal integrity on the link under test or whether you need to decode the packet data. The tools are different. Luckily, USB 2.0 protocol analysis is much cheaper these days than scope decoders...

author: Titan 4380
author_rank: Contributor
timestamp: August 25, 2017, 12:44:12 am
content: Thanks for all replies and suggestions. Let me reframe my original question;What would I need to read or decode ASCII traffic coming from a USB 2.0 device. If for example, If I wanted to read XYZ data from a USB stepper driver, what would I need to do that?

author: TK
author_rank: Super Contributor
timestamp: August 25, 2017, 01:55:28 am
content: Is the data coming from a native USB device or a "serial UART" device through a USB bridge? Maybe you just need a serial decoder (UART).

author: Titan 4380
author_rank: Contributor
timestamp: August 25, 2017, 02:29:19 am
content: I have several FTDI based converters that I could use in conjunction with my scope, but I would like to understand if I will see anything meaningful on the screen. What I am not understanding is that if I use a USB to RS232 converter, how does the data go from 480MBPS to a crawl of 9600 bps or even 115200bps without a giant buffer

author: BradC
author_rank: Super Contributor
timestamp: August 25, 2017, 02:38:53 am
content: Quote from: Titan 4380 on August 25, 2017, 02:29:19 amNo you won't.Quote from: Titan 4380 on August 25, 2017, 02:29:19 amBecause it uses a very small buffer and a lot of handshaking. The driver sends a packet, the device clocks it out. While it's clocking it out it's responding to driver polls with "don't send me anything else, I'm not ready". As soon as it has enough buffer space it responds with "ok, thanks I'll take that data now".Grab a copy of the USB 2.0 standards and have a read on bulk transfers. It's relatively simple and easy to understand.

author: Titan 4380
author_rank: Contributor
timestamp: August 25, 2017, 03:06:02 am
content: Thanks to all for some very informative, but ultimately disappointing answers. I am digressing here, but why does my scope have a selectable USB trigger, but no decoder?

author: Dubbie
author_rank: Unknown
timestamp: August 25, 2017, 04:07:49 am
content: John's answer explains this.USB is a complicated multilevel protocol that is far beyond a normal scope to decode.Triggering is much much simpler.

author: jjoonathan
author_rank: Frequent Contributor
timestamp: August 25, 2017, 04:54:03 am
content: Makes sense, thanks.

author: exe
author_rank: Unknown
timestamp: August 25, 2017, 01:59:58 pm
content: Just in case, if signal integrity is fine, then you can lower communication speed to, e.g., 12Mbps and use a cheap scope to troubleshoot. But it looks like your problem is purely software and doesn't even need any hardware. I think there should be a way to sniff USB bus from OS.

author: tmbinc
author_rank: Frequent Contributor
timestamp: August 25, 2017, 11:42:26 pm
content: Quote from: Titan 4380 on August 25, 2017, 12:44:12 amThe most obvious answer - that unfortunately doesn't include a scope or analyzer - is: Use a software tracer.The issue with software is that a.) you need to run the code instrumented (i.e. if the USB host is locked down, or doesn't run on a PC / Linux board, you're out of luck), and b.) software trace suck. (The reason is that the interface to the USB host controller is very different from what happens on the bus: you enqueue packets, and the USB controller takes care of it, and gives you a result. Hence what you see in the trace is only what happened on the bus in a _successful_ case. This makes USB debugging slightly painful if you can't see what's happening on the bus. But not your issue here as you appear to have a working setup.)There are also solutions for virtualization software, so you can run an unmodified OS/Software in a VM, and expose the host's USB device into it, and then log the data.Or you could LD_PRELOAD/Detour calls into the USB library (libusb if you're lucky) and trace the messages this way. Involves a bit of coding but you can get much better results because you have more context.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 26, 2017, 07:19:53 am
content: I remember reading that you could use a Beaglebone - which can do USB 2.0 host and USB 2.0 gadget at the same time - as a USB sniffer.

author: Titan 4380
author_rank: Contributor
timestamp: August 26, 2017, 11:12:05 am
content: Wanting to read USB2.0 traffic is like a trip down the rabbit hole and gets more complex after each post. I jumped from an early 90's CRO to a DS2000 scope thinking that these new wonder devices would enable me to decode and freeze the data coming from a USB stepper driver. I wasn't so interested in the waveforms, but more the ASCII data being transmitted. I did considerable research (i.e.:looked at this forum) to understand that I could purchase a DS2070 scope and end up with a 300mhz unit with all triggers at no cost . I should have done more research to find out what is involved in monitoring USB transmissions.

author: nctnico
author_rank: Super Contributor
timestamp: August 26, 2017, 11:39:19 am
content: When dealing with USB (or any serial interface like ethernet, PCI express) the electrical interface is the least interesting part. What you need is a USB protocol analyser!

author: Leo Bodnar
author_rank: Frequent Contributor
timestamp: August 26, 2017, 02:59:22 pm
content: If you want to decode USB in hardware your best solution is USB protocol analyser with its associated software package.The device class communications are quite complex and make almost no sense as just hex dumps. You will drown in raw data.I am using:https://www.totalphase.com/products/beagle-usb480/http://teledynelecroy.com/protocolanalyzer/protocoloverview.aspx?seriesid=414&capid=103&mid=511There are alsohttps://www.ellisys.com/products/usbex200/index.php(industry standard)and few others...http://janaxelson.com/development_tools.htm#analyzersBefore you make a jump make sure you are getting the right device class decoders in your software.Otherwise you'll be looking at expensive and nicely formatted hex packets of raw data. Often extra class decoders are extra, e.g. look at Ellisys pricing structure.Teledyne Lecroy software is free, has lots of decoders and allows you to write your own decoding add-ons so if you are working with some proprietary data you can present it in a sensible way as [huge amounts of] data is streaming past.Hardware analysers allow capturing sub-microsecond hardware timestamps so you can fix all the subtle problems in your MCU.I wouldn't use scope unless you:are syncing or analysing USB traffic interaction with external events on ~microsecond levelare designing low level stuff (PHYs, converters, isolators, etc)have signal integrity or EMC problemsBy the way Mercury T2 has input for external trigger. It is my favourite analyser to date.Total Phase software is simple, easy to use and also works on Mac and Linux.CheersLeo

author: abraxa
author_rank: Frequent Contributor
timestamp: August 26, 2017, 08:38:04 pm
content: Quote from: Titan 4380 on August 25, 2017, 12:44:12 amIf you just want to sniff the data, you could also usehttps://wiki.wireshark.org/CaptureSetup/USBto do this on the PC side.

author: Titan 4380
author_rank: Contributor
timestamp: August 26, 2017, 11:16:25 pm
content: Thanks for your suggestions Leo. Its ironic that you should jump in on this thread, because it is one of your devices that I am also interested in monitoring to see how it can be implemented in other ways.Specifically, the BU0836X turned out to be an extremely reliable and robust unit, but I am convinced that its full potential has yet to be unlocked.

author: Howardlong
author_rank: Super Contributor
timestamp: August 29, 2017, 03:10:07 pm
content: Quote from: Leo Bodnar on August 26, 2017, 02:59:22 pmWhich ones offer external trigger (either in or out, but preferably both)?I can see that the Ellisys has it but not sure about the others.

author: Leo Bodnar
author_rank: Frequent Contributor
timestamp: August 29, 2017, 03:29:57 pm
content: Quote from: Howardlong on August 29, 2017, 03:10:07 pmhttp://teledynelecroy.com/protocolanalyzer/protocoloverview.aspx?seriesid=414&capid=103&mid=511They sell a cable for it but it's just a standard DIN connector on the back. It is both IN and OUT.https://store.teledynelecroy.com/products/ac032xxa-x-mercury-external-trigger-cableLeo

author: Howardlong
author_rank: Super Contributor
timestamp: August 29, 2017, 07:31:04 pm
content: Quote from: Leo Bodnar on August 29, 2017, 03:29:57 pmOK, thanks, very useful. I went for the LeCroy Mercury T2C standard, I may well need to do power delivery protocols later, but unlikely to need the advanced option's facilities. Either of those options can be purchased separately.The ITIC solution is reasonably priced but seems to lack an external trigger: my current use case is figuring out what is happening in an MCU based HS device when performance inexplicably drops, so I need to time correlate MCU telemetry on the scope with the bus analyser. The signal integrity looks fine, it's a firmware problem in a vendor provided USB library under load.The Ellisys stuff seems to be priced stratospherically as soon as you want external triggers.The Beagle options appeared about 50% more expensive than the LeCroy T2C.

author: bill@geektrap.com
author_rank: Newbie
timestamp: April 01, 2019, 02:27:58 pm
content: WireShark software is free and open-source and works quite well. Just add the USB decoders. I've used it and a LeCroy Catalyst together and have no complaints about it.