| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Logic Analyzer Fun

Page history last edited by Megan Wachs 14 years ago

 

In lab 1 you learned about the multimeter, the waveform generator, the oscilloscope, and the power supplies. There is one more tool at each station, the Logic Analyzer. You can think of the Logic Analyzer as a very complicated oscilloscope, but instead of continuously monitoring analog signals, the Logic Analyzer(LA) just captures digital signals (1's and 0's) at one snapshot in time. There are actually 4 different models of LA's in the lab, but they all work in essentially the same way (there is just some variation in how to actually navigate around and enter text). The screenshots are all from the 1661A machines in the lab. Text in grey tells you how to change the configuration, which you don't need to do for this example, but might be useful to you in the future.

 

DATA6029.JPG

 

What is the LA for?

 

It is very useful for debugging your circuit. In coding, we often use "printf" or something similar to output variables at certain points in our code to figure out whether code is getting run, or not behaving as we expect. The LA is the hardware equivalent. For example, if you expect your code to send a message to the LCD when a button is pressed, you can hook up the logic analyzer and see exactly what message is getting sent, to help debug any problems.

 

Why would you not use the LA?

 

While the o-scope is very easy to poke in and see whether a signal is wiggling up and down, the LA takes a fair bit of configuration to measure all the signals that you want. For this activity, the TAs have already set up the configuration file and saved it to the LA disk, so that tedious work is all taken care of for you.

 

Example - monitoring a message to the LCD

 

Your Teensy communicates with the 16x2 digital LCD with a few sets of wires: RS, E, and DB4-7.  Let's use the LA to watch what happens when the Teensy sends a command to the LCD.

 

Step 1: Loading Configuration ("System" Menu)

You will need a floppy disk in the LA for this step (but not later steps, and you might have to share).

If it's not already, turn on your LA and wait for it to boot (the older ones have a switch in the middle back). Then find the button for interfacing with the floppy: the newer LA's have a  "System" button, the older ones call it "I/O". Once you get to the System menu, load the configuration "LCD16X2". Once you do this you don't need the floppy any more. You can use this same menu to save configurations if you make changes, and also save traces. Just select the "Load" box and change it to "Store".

 

p4200233.jpg

 

Step 2: Hooking up Your Circuit ("Config" Menu)

Find the "Config" button ("Format" only on the older LA's) and hit it. You should get a list of signals (RS, E, and DB) followed by some rows of "." and "*". All of them are listed under "Pod 1". This screen is showing what wires we have named.

Screenshot of the

So, find the octopus-like connector on your o-scope that is labeled "Pod 1" (there are several different pods, you can measure a lot of signals with the LA!). Note that each Pod has 16 signal wires (0-15), a black wire (GND), and a few other wires.

Octopus Dongle

 

Hook your black wire to GND on your circuit. You can use small wires from your jumper kit to make the connections.

 

Now, look at the menu. There is a "*" in the 0 position of Pod 1 for RS. So, that means the LA will call the signal on Pin 0 "RS", so you should hook it to RS in your circuit. Do the same for E... what pin does E correspond to?

 

There are several "****"s for DB. That means that the LA will group those signals together as a bus and give a hex value to them. So hook them up to DB4-7 on your circuit.

 

To assign these yourself, first select the wire name on the left and say "modify". Then enter the name you want the signal to have. Then go to the "Pod1" column and select the box. Enter "*"s for the wires that correspond to the signal, and "." otherwise.

 

Step 3: Observing Signals ("Waveform" Menu)

Hit the "Waveform" ("Display" on older LAs) menu button. This brings up the actual waveform.

Screenshot of Waveform

To make the LA start monitoring your signals, hit the "Run" button. To make it stop and show what it's observed, hit "Stop". This will show you the current values of the signals to the LCD. But, most likely nothing interesting happened in that window! We need to tell the LA exactly when it should start recording so that we make sure we see the instruction to the LCD! So we need to set up a "trigger", which tells the LA when to start recording.

 

To add your signals to the waveform, select the left side (where the signal names are) and say "Insert". Pick the signal you want to insert. If it's a single-bit signal, just pick "bit 0". If it's a multi-bit signal, you probably want to select "bus" to see the whole hex value on one line.

 

Step 4: Triggering Signals ("Trigger" Menu)

Find and hit the "Trigger" ("Trace" on older machines) menu button. To set the trigger, you have to know something about the signals that you are observing. For example, maybe you are expecting something to happen right after you hit a button. In that case, you could use the button as your trigger.

 

For our example, we know (if we read the data sheet) that when the "E" signal goes high, we are sending a message to the LCD. So, let's use the E signal as our trigger. Since we care about when it goes high, we will use the "rising" edge of the E signal. This step has already been done for you, but since it is the most complicated we will walk you through it in case you wanted to make changes.

 

The large box at the top explains what sequence of events we want to happen before we start recording. So, we are going to start recording when "Edge 1" happens once. To define what "Edge 1" is, we go down to the table towards teh bottom, and in the row for Edge1, pick the box under "E". When we select it we get to choose what kind of edge. The up-arrow is rising edge, so select that.

 

Setting the Trigger 1

Setting the Trigger 2

 

Setting up the triggers is as complicated as you want it to be, and you can create quite intricate sequences of events (such as, only trigger if E goes high within 10 ns of RS going low three times). Honestly, just explore this screen to see the possibilities.

 

Step 5: Really Observing Signals ("Waveform" Menu)

Go back to your waveform. Program your Teensy with the LiquidCrystal->Display program that blinks "Hello World!". Then, hit the "run" button on your LA. After a moment or two it should stop itself (because it has been triggered when your Teensy sent a command to the LCD). Now it will display your signals! Notice that the trigger (where "E" goes high) is centered on the screen.

 

You can use the "timescale" button to zoom in and out. Remember that when you zoom in you should run the waveform again because it will sample at a finer resolution when you zoom in.

 

 

 

 

 

 

 

 

 

Comments (0)

You don't have permission to comment on this page.