Author Topic: Why bother buying a USB logic analyzer?  (Read 6274 times)

0 Members and 1 Guest are viewing this topic.

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Why bother buying a USB logic analyzer?
« on: February 28, 2016, 10:56:19 pm »
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)
 

Offline Zbig

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Why bother buying a USB logic analyzer?
« Reply #1 on: February 28, 2016, 11:01:56 pm »
And connect the probed signals where exactly?
 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #2 on: February 28, 2016, 11:06:10 pm »
to the wires of a usb cable comming out from the pc like this one
 

Offline Zbig

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Why bother buying a USB logic analyzer?
« Reply #3 on: February 28, 2016, 11:10:12 pm »
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.
 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #4 on: February 28, 2016, 11:13:53 pm »
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$.
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: Why bother buying a USB logic analyzer?
« Reply #5 on: February 28, 2016, 11:18:35 pm »
Gotta be a troll
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6190
  • Country: us
Re: Why bother buying a USB logic analyzer?
« Reply #6 on: February 28, 2016, 11:41:47 pm »
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$.

Let us know how it works for you.

Computers have different hardware so you may need to try on more than one.
 

Offline AlessandroAU

  • Regular Contributor
  • *
  • Posts: 168
  • Country: au
Re: Why bother buying a USB logic analyzer?
« Reply #7 on: February 28, 2016, 11:44:01 pm »
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, FYI
http://www.ebay.com.au/itm/New-USB-Cable-24MHz-8-Channel-24M-Logic-Analyzer-Device-Set-Flux-Workshop-S-/151841206516?hash=item235a70f0f4:g:AFEAAOSwNNxWFQ7G

 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #8 on: February 29, 2016, 12:00:47 am »
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?
« Last Edit: February 29, 2016, 12:47:12 am by JustAnotherGuy999 »
 

Offline MrSlack

  • Frequent Contributor
  • **
  • Posts: 880
  • Country: gb
Re: Why bother buying a USB logic analyzer?
« Reply #9 on: February 29, 2016, 12:03:02 am »
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.aspx

Don't cut up any cables - you can inspect the USB protocol as it goes by with whatever you have plugged into it.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8275
Re: Why bother buying a USB logic analyzer?
« Reply #10 on: February 29, 2016, 01:29:04 am »
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.
Actually...

maybe you should do some reading too. ;)
 

Offline michaeliv

  • Frequent Contributor
  • **
  • Posts: 260
Re: Why bother buying a USB logic analyzer?
« Reply #11 on: February 29, 2016, 01:53:13 am »
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 ?
 

Offline Shadetreeprops

  • Regular Contributor
  • *
  • Posts: 132
  • Country: us
  • Backwater building
Re: Why bother buying a USB logic analyzer?
« Reply #12 on: February 29, 2016, 01:58:40 am »
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  :bullshit: :bullshit: :bullshit:
Buy it, use it, break it, fix it, Trash it, change it, mail upgrade it, Charge it, point it, zoom it, press it, Snap it, work it, quick - erase it,
 

Offline michaeliv

  • Frequent Contributor
  • **
  • Posts: 260
Re: Why bother buying a USB logic analyzer?
« Reply #13 on: February 29, 2016, 02:07:33 am »
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  :bullshit: :bullshit: :bullshit:
I 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.
 

Offline ade

  • Supporter
  • ****
  • Posts: 231
  • Country: ca
Re: Why bother buying a USB logic analyzer?
« Reply #14 on: February 29, 2016, 02:23:55 am »
Terminology:

USB logic analyzer is not the same thing as a USB protocol analyzer.  Note the underlines.

(Although some logic analyzers can decode USB protocols as well.)
 

Offline AlessandroAU

  • Regular Contributor
  • *
  • Posts: 168
  • Country: au
Re: Why bother buying a USB logic analyzer?
« Reply #15 on: February 29, 2016, 02:42:33 am »
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.
Actually...

maybe you should do some reading too. ;)


Well 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...
 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #16 on: February 29, 2016, 10:31:11 am »
michaeliv those are the answers i was looking for, thanks, thanks all of you (y) (y)
 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #17 on: February 29, 2016, 10:38:11 am »
AlessandroAU the logic analyser you pointed out to is just 24MHz, usb2 (high speed) is 480MHz
 

Offline 1xrtt

  • Regular Contributor
  • *
  • Posts: 70
  • Country: br
Re: Why bother buying a USB logic analyzer?
« Reply #18 on: February 29, 2016, 05:57:34 pm »
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:
« Last Edit: February 29, 2016, 05:59:50 pm by 1xrtt »
 

Offline michaeliv

  • Frequent Contributor
  • **
  • Posts: 260
Re: Why bother buying a USB logic analyzer?
« Reply #19 on: February 29, 2016, 06:22:14 pm »
If you  want to see the USB protocol data, you can use the latest Wireshark
Yes, 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 ?
 

Offline 1xrtt

  • Regular Contributor
  • *
  • Posts: 70
  • Country: br
Re: Why bother buying a USB logic analyzer?
« Reply #20 on: February 29, 2016, 06:51:01 pm »
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
What you won't see using USBPcap
 
As USBPcap captures URBs passed between functional device object (FDO) and physical device object (PDO) there are some USB communications elements that you will notice only in hardware USB sniffer. These are:
 •Bus states (Suspended, Power ON, Power OFF, Reset, High Speed Detection Handshake)
•Packet ID (PID)
•Split transactions (CSPLIT, SSPLIT)
•Duration of bus state and time used to transfer packet over the wire
•Transfer speed (Low Speed, Full Speed, High Speed)
Moreover, you won't see complete USB enumeration. You will only see the USB control transfer send to device after the device has been assigned its address.
 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #21 on: February 29, 2016, 07:15:25 pm »
Is the same thing happens with Ethernet? (a software is not able to show us all)
 

Offline 1xrtt

  • Regular Contributor
  • *
  • Posts: 70
  • Country: br
Re: Why bother buying a USB logic analyzer?
« Reply #22 on: February 29, 2016, 10:05:57 pm »
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.
 

Offline JustAnotherGuy999Topic starter

  • Contributor
  • Posts: 46
  • Country: ma
Re: Why bother buying a USB logic analyzer?
« Reply #23 on: February 29, 2016, 10:16:05 pm »
Thanks guys (y)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf