Why bother buying a USB logic analyzer? - Page 1
Forum section: electronics / beginners

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 28, 2016, 10:56:19 pm
content: Can't we just use a computer and a software to do the job?If so, in which case one must buy a logic analyser, they are damn expensive (im talking about usb2 and usb3 analysers)

author: Zbig
author_rank: Frequent Contributor
timestamp: February 28, 2016, 11:01:56 pm
content: And connect the probed signals where exactly?

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 28, 2016, 11:06:10 pm
content: to the wires of a usb cable comming out from the pc like this one

author: Zbig
author_rank: Frequent Contributor
timestamp: February 28, 2016, 11:10:12 pm
content: You really should do some reading on how USB actually works. And don't even think of connecting this to your computer if that's your photo.

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 28, 2016, 11:13:53 pm
content: a computer (an old one) is much cheaper than a usb logic analyzer, the worst case is that the computer burns, and i lose 50$.

author: Skimask
author_rank: Super Contributor
timestamp: February 28, 2016, 11:18:35 pm
content: Gotta be a troll

author: zapta
author_rank: Super Contributor
timestamp: February 28, 2016, 11:41:47 pm
content: Quote from: JustAnotherGuy999 on February 28, 2016, 11:13:53 pmLet us know how it works for you.Computers have different hardware so you may need to try on more than one.

author: AlessandroAU
author_rank: Regular Contributor
timestamp: February 28, 2016, 11:44:01 pm
content: In case this is not a troll...You cannot just ask the computer to tell you what the state the pins are at on the USB port or directly sample it in any way.The USB port understands the USB protocol and nothing else, it can't be used a general purpose logic analyser. Besides, two pins are power and ground and the other two are a differential pair D+ and D-, so there is really only one data pin anyway.There are no stupid questions, but if these concepts are unfamiliar you should do some reading before playing around with this kind of stuff.You can get a logic analyser for $10, FYIhttp://www.ebay.com.au/itm/New-USB-Cable-24MHz-8-Channel-24M-Logic-Analyzer-Device-Set-Flux-Workshop-S-/151841206516?hash=item235a70f0f4:g:AFEAAOSwNNxWFQ7G

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 29, 2016, 12:00:47 am
content: i want to use the pc to analyze usb protocol only. if it can't why?, if it can why there are usb protocol analyzers?

author: MrSlack
author_rank: Frequent Contributor
timestamp: February 29, 2016, 12:03:02 am
content: I see. If you want to check out a USB protocol then use this if you're on Windows:https://msdn.microsoft.com/en-us/library/windows/hardware/dn741264%28v=vs.85%29.aspxDon't cut up any cables - you can inspect the USB protocol as it goes by with whatever you have plugged into it.

author: amyk
author_rank: Super Contributor
timestamp: February 29, 2016, 01:29:04 am
content: Quote from: AlessandroAU on February 28, 2016, 11:44:01 pmActually...maybe you should do some reading too.

author: michaeliv
author_rank: Frequent Contributor
timestamp: February 29, 2016, 01:53:13 am
content: It depends on what you are trying to debug.Here is my understanding of what tool you need for a specific problem.If the problem is that the device is outputting a signal level on the data pins that is too high/low/bad rise time, etc, you need an oscilloscope to debug. A PC cannot read signal levels beyond 1/0. Neither can a logic analyzer.If the problem is that the device outputs correct signal levels but does not follow the USB protocol, you need a USB logic analyzer to debug. Your PC cannot debug this as it expects the slave to follow the correct protocol. Would you expect to be able to plug in your DVD player's HDMI output into the SATA2 bay of the motherboard where the DVD drive is normally plugged in and see why you can't view a movie ?If the problem is that the device is outputting correct signal levels, correct USB data, however the data is in the incorrect format ( different than the driver expects ), you can debug this with the PC.amyk seems to indicate that an Intel controller may have the ability to read the direct digital values of the data pins. However, it is not clear if you can actually access this via a driver or that information is meant for motherboard manufacturers etc. And if you can access the digital pin values it's doubtful that there is any tooling that would allow you to do any type of debugging.@amyx, maybe you can share more info ?

author: Shadetreeprops
author_rank: Regular Contributor
timestamp: February 29, 2016, 01:58:40 am
content: yep smelling troll. casue i am a complete freaking noob to this stuff and know you cant do what he is asking. im a 2 month EE starter, not even a EE like a EA Electrical apprentice and know this has got to be

author: michaeliv
author_rank: Frequent Contributor
timestamp: February 29, 2016, 02:07:33 am
content: Quote from: Shadetreeprops on February 29, 2016, 01:58:40 amI think you may be misunderstanding the question.The difference is quite subtle --http://www.totalphase.com/solutions/apps/usb-analyzer-benefits/My understanding is that OP wants a software-only solution for analyzing data over a USB bus.

author: ade
author_rank: Unknown
timestamp: February 29, 2016, 02:23:55 am
content: Terminology:USBlogic analyzeris not the same thing as aUSB protocolanalyzer. Note the underlines.(Although some logic analyzers can decode USB protocols as well.)

author: AlessandroAU
author_rank: Regular Contributor
timestamp: February 29, 2016, 02:42:33 am
content: Quote from: amyk on February 29, 2016, 01:29:04 amWell you learn something everyday. I wonder what speed you could poll that information at, it might very well be possible to have a 2 wire logic analyzer...

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 29, 2016, 10:31:11 am
content: michaeliv those are the answers i was looking for, thanks, thanks all of you (y) (y)

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 29, 2016, 10:38:11 am
content: AlessandroAU the logic analyser you pointed out to is just 24MHz, usb2 (high speed) is 480MHz

author: 1xrtt
author_rank: Regular Contributor
timestamp: February 29, 2016, 05:57:34 pm
content: If you want to see the USB protocol data, you can use the latest Wireshark (http://www.wireshark.org) version, that brings USBCap embedded. I was about to upgrade it when I saw this thread, so I just made a quick test:It listed correctly my Hantek DDS-3X25:I did not try to make sense of the data, but seems to capture just fine:

author: michaeliv
author_rank: Frequent Contributor
timestamp: February 29, 2016, 06:22:14 pm
content: Quote from: 1xrtt on February 29, 2016, 05:57:34 pmYes, viewing protocol data is certainly possible. The question is can you spoof invalid / corrupt packets ?Practical Example: If I use my signal generator to generate valid electrical signals over the data lines, but I continuously send a random stream of 0's and 1's, with no header, not in a packet format, can you use Wireshark to reconstruct the random stream of bits, including timing information ?

author: 1xrtt
author_rank: Regular Contributor
timestamp: February 29, 2016, 06:51:01 pm
content: Certainly not. That's not the purpose of this tool. For that you need a hardware sniffer or some sort of software that taps directly to the bitstream of the USB interface (can't say if it's possible by software, I have not enough knowledge).USBCap lists some limitations:http://desowin.org/usbpcap/capture_limitations.html:Quote

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 29, 2016, 07:15:25 pm
content: Is the same thing happens with Ethernet? (a software is not able to show us all)

author: 1xrtt
author_rank: Regular Contributor
timestamp: February 29, 2016, 10:05:57 pm
content: Correct, Basically, with Wireshark and other software sniffers, you can only tap into driver level. For example, some network cards do packet CRC calculation, inside the hardware, and that information never gets to upper levels. So, the amount of information you can look at depends on that piece of software that interfaces the OS to the hardware (the driver).Even if you can write your own driver for a network card, to try get a deeper look, I believe at most you'll get the contents of the buffer memory of the card. It won't get you information like bit timing and perhaps not even corrupted packets, as the card may discard them before pushing up to OS.

author: JustAnotherGuy999
author_rank: Contributor
timestamp: February 29, 2016, 10:16:05 pm
content: Thanks guys (y)