rocketnumbernine

Andrew's Project Blog: Hardware, Software, Stuff I find Interesting

I've been thinking of getting a "cheap" computer based Logic Analyzer for some time. There's a quite a few around, at the low end they seem to fall into two groups:

  • Those with inbuilt memory/buffering that can sample at rates of 100MHz+ and cost around £300/$500. For example, the LA1034 LogicPort and DigiView DV1-100
  • Those with no or little memory/buffering that rely on transferring the data to a computer through USB that can sample at 20-25MHz and cost around £100/$150. For example, the USBee SX and Saleae Logic.
  • Whilst some of the more expensive analyzers have very useful features, I don't think I'd utilize them enough to justify the cost - I can't see needing greater than 20 MHz sampling in the near future (I'll mainly be looking at I/O pins of MCUs running at less than 16MHz) and 8 inputs is probably enough, I'd rather get something cheaper now and purchase an oscilloscope later. I ended up choosing the Saleae Logic because:

    1. The software (which can be downloaded and run in demo mode) seems intuitive and quick to learn and they're promising mac and linux versions.
    2. The device looks cute.
    3. There seems to be a few people using them with no major issues reported.

    I ordered Sunday directly from Saleae ($150 + $30 USPS Express Mail), it shipped Monday, and arrived Thursday (less than 60 hours door-to-door from San Francisco to London) with no added duty from UK customs!

    Out of the Box

    Out of its case with USB cable, 20cm patch cable, and packet of E-Z-Hook probe clips the Logic looks tiny, although its metal case is stylish and rugged. The patch cable fits snugly into the Logic, as has been commented on elsewhere it's possible to plug them into the Logic upside down (which according to a Sparkfun product page comment can permanently damage the device). Otherwise the patch cables and probes are superb.

    Saleae Logic out of the box

    Running under Parallels

    I normally use a Mac, and there have been reports of people using the Logic on Windows XP running under Parallels, although Saleae say it will run slower. Running on Windows XP via Parallels on a MacBook, I failed to get it to sample above 0.2MHz so all the following examples were done on a PC. This is a disappointment - hopefully a Mac version will be available soon.

    Test of Maximum Sampling Rate

    To test the maximum sampling rate a simple Arduino program was used that toggled an IO pin between 0 and 1. Another pin was set high before the loop to use as a trigger to the Logic:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    void loop() {
      digitalWrite(0, HIGH);
      for (int i=0; i<10; i++) {
        digitalWrite(1, LOW);
        digitalWrite(1, HIGH);
      }
      digitalWrite(0, LOW);
      delay(500);
    }

    A Logic probe hook wire was connected to pin 0 and 1, and the grey ground pin to the Arduino Ground.

    Saleae Logic analysis of simple clock signal

    Above shows the two input pins as seen on the Logic, the first two trigger bits on pin D0 was set to 0 and 1 so the logic would start recording when it sees that pin go from low to high. All that needs to be done is to set the sampling rate, the amount of data to capture (ideally the logic would allow you to specify this by time as well as bytes) and press sample. As soon as the device sees the trigger pattern on pin D0 it begins to sample and the data can be seen on the screen.

    The Logic shows that the signal is non-symmetrical - the low phase is 3.333μs, whilst the high is 3.667μs, the 3.333 is the time for the digitalWrite, whilst the longer high signal time also includes the overhead of the for-loop (incrementing and compairing i).

    Protocol Analyzers

    The Logic comes with protocol analyzers for I2C, SPI, Serial and 1-Wire which can simplify investigation by decoding the binary pin levels into more user readable values according to the protocol. Upto four analyzers can be configured and then applied to the main logic analyzer window (so configurations for different chips and circuits can be saved).

    The following shows a two byte analysis of the SPI communication between an Arduino and a Analogue to Digital Converter described here.

    Saleae Logic analysing a SPI signal

    Conclusion

    The Logic seems a great device and is well worth the investment - It has excellent functionality, works as described, and has great looking hardware and software, the only caveat is that Mac and Linux software isn't yet available.

    It looks like your browser doesn't support javascript so comments won't work

    Tags/Categories: arduino, SPI, Saleae Logic, USB, reviews