Well hello there, if you’ve been looking at the amazing line-up of Saleae gear and wondered how to get started with it all, then you’ve come to the right place. Today we’re going to take a look at getting your Saleae setup for the first time, analysing some signals using the Saleae software, and going through some tips and tricks to get the most out of your logic analyser.
Today we’ll be using the Logic 8 as an example, however, the process and software are exactly the same no matter what model you’re using. If you’re not sure what the differences are between each model, then take a look at our Saleae Models Compared article which looks at the key points between the Logic 4, Logic 8, Logic 8 Pro and the Logic 16 Pro. And if you’re not really sure what a logic analyser is, but it sounds cool, no problem, go and check out our article on What is a Logic Analyser.
The Gear
To follow this tutorial you will need……. *drumroll*…….a Saleae Logic Analyser!
First Time Setup
To power on your Saleae, simply connect it to your computer via the included USB cable, to get started with it, you’ll need to download the Logic software which is available on the Saleae website. Once installed, the software will automatically recognise your Saleae model and open into the capture screen.
Analysing a Signal
As fun and all as it is to drool over the features, and nice packaging, let’s get stuck into analysing and measuring our first signal. Now you can use anything you like for this, a digital output pin, incoming sensor data etc. however for this tutorial we used a Particle Photon to generate a PWM signal, output WS2812B NeoPixel data, and an Arduino Uno to send some I2C data for us to analyse. You don’t have to follow along with the hardware side of things, you can use whatever signal you like.
So first of all, we want to unplug our Saleae from power (not 100% necessary, but good practice) and connect up the wiring harnesses to the back of the unit making sure that the Black ground wires are on the lower half. The easiest way to connect to a pin that isn’t breadboard is to use the clips included with your analyser. There are 16 clips included which have pins to attach the wire harness to, and spring loaded ‘grabbers’ to grab onto a small contact.
For the example, we’re connecting the pins in the following configuration:
- 0: SDA (I2C data)
- 1: SCL (I2C clock)
- 2: PWM
- 3: NeoPixel
- 4: Trigger
So we’ve got 5 lines in total, with the fifth being used to listen for a trigger being sent from the Photon to allow us to record in sync, but we’ll get to triggers further down. Bear in mind that if you're using the Logic 4, as it only has 4 channels, you will either need to drop the trigger or one of the other data lines.
If you're not 100% sure on how I2C communication works, getting in with a logic analyser will certainly help, but for a good introduction, check out our article on I2C with Arduino.
By default, the software will show the analogue and digital signals on all the pins, however, you can control which ones you want to see by going to the capture settings and toggling various lines on/off.
Now, for ease of use its good practice to name the channels, so you can see in our example, we’ve labelled each channel according and only selected the 5 channels we’re using to be displayed. Now we’ve set up a trigger in the code for the Photon which pulls digital pin 3 HIGH during the setup, then LOW again, and we can use this to tell our Saleae only to start recording when it receives this trigger so that all of the timings are in sync. More specifically in the Photon’s code, in the main loop, we’re ramping up a PWM signal, then every 100mS we’re sending out colour pulses to the NeoPixels, and requesting data from the Arduino over the I2C bus. All that’s left to do now is to go back to the capture settings and choose how long we want to record for. Bear in mind that recording uses the host computer’s RAM so you’ll be limited by that especially if you’re recording on lots of channels, the good part is that if you’re analysing a standard, digital data packet, everything happens so quickly you don’t need to be recording for very long. We’ve done a 2-second recording, which is quite long, but it will show all of the repeated events we’re capturing. Now everything is setup and we can analyse our signals, that’s all there is to it! So let’s hit the capture button and take a look at this data.
Creating a Trigger
As you can see, it’s just a lot of 1’s and 0’s taken from the input voltages. If you look at the analogue line vs the digital line you can see that they don’t match up. This is because a digital 1 isn’t triggered when the voltage reaches the HIGH voltage, it's triggered when it passes a threshold, usually around the 2.7-3.3V mark. Now all of this data is great, but the timing doesn’t sync up nicely to our microcontroller so we’re going to set a trigger line to start recording when channel 4 goes high, to do this, go to channel for and select the appropriate trigger type from the little box on the left-hand side, next to the gear symbol. The trigger we’re using is a high signal so we’ve selected the high logic trigger, however, you can use any kind of trigger you want. Now we can restart the Photon (or wherever your signal is coming from) and hit capture and it won’t start capturing until it detects that trigger.
Awesome, now we’ve got a nice clean data capture. You can see a slight offset every 100mS where our ‘100mS’ event happens, this is because the 100mS time is calculated using a dirty old software timer that isn’t 100% spot on and doesn’t take into account the process happening in between, but for this example, it works well enough.
Creating an I2C Analysis
Now we can see the I2C clock along with the data being transmitted every 100mS, but it’s pretty hard to see what’s actually being transmitted just as a bunch of 1’s and 0’s. Fortunately, this is where the power of logic analysers comes in, they don’t just measure the 1’s and 0’s, they can analyse standard communication protocols and recognise what is being communicated. To setup an analysis, go to the ‘Analyzers’ tab (lame American spelling) and choose which communication protocol you want to analyse (we’re using I2C) and select the appropriate channels (SDA, SCL). And now ladies and gentlemen, let’s see what happens when we capture this set of data:
Woooooo! Isn’t that awesome! If you mouse of the I2C data packets, not only can you see each individual byte, but it tells you what each byte is, in this case, a series of ASCII characters which spells out ‘hello’.
Not only will Saleae's software analyse the data packets for you, but if you hover over each bit, it will show you the length of the pulse and voltage levels.
Tips and Tricks
As you can see, getting started with Saleae is incredibly easy and the intuitive software makes complex analysis simple, however, there's a few extra tips and tricks which may not be immediately apparent which can help make your Saleae experience that extra bit more awesome.
Changing the RGB LED Colour:
The indicator LED on your Saleae is blue by default, however, it's an RGB LED which lights up when you connect to the Saleae software and you can configure it to be whatever colour you like! Simple open your Logic software, connect your device and go to the capture settings, then click on the small gear icon in the top right-hand corner of the connected analyser and you will see several colours presets, or you can click 'custom' to make your own colour with the RGB mixer or use a Hex colour such as #006188.
Using the Capture Tabs:
When you take a capture, you will often want to take several to compare multiple events or separate sets of data. Each time you make a new capture, Saleae will take the previous capture and store it in a new page as a tab. These tabs are kept in the bottom left of the window:
This is a quick overview of the power that logic analysers hold, and how quickly it is to get up and running with Saleae and their intuitive software, however, there is an incredible amount of features which we haven’t even looked at yet such as creating your own custom analysis protocols and much more! For more awesome Saleae content, check out our other tutorials, and get making!