Introduction: Using the Analog Discovery to Debug Digital Logic

The Analog Discovery is a tool most commonly used in Analog Circuits Classes. Used for its Oscilloscope, Waveform Generator, Network Analyzer, and Power Supplies, all great features.

However, many students go through those analog classes wondering, what are all of the wires to the right of the analog stuff. If you did do that, not to worry, I felt the same way.

It wasn't until my second digital logic class that I was introduced to the Logic Analyzer on the Analog Discovery. It allows you to view digital signals in real time, and interpret them.

In this Instructable I go through how to use the logic analyzer with a SPI demo on the Basys 3 as an example.

To read more about my experience read this blog post.

Step 1: Gather Materials

What You'll Need:

- 1 Basys 3 or Nexys 4 DDR

- 1 PmodAMP2

- 1 PmodMIC3

- 2 6 Pin Pmod Cables

- 3 6 Pin Gender Changers

- 1 Breadboard

- 1 Analog Discovery 2 or Analog Discovery

- 2 USB A to B micro Cables

- Waveforms 2015 or Waveforms Classic Installed

- Xilinx Vivado Installed and Licensed

If you have another output you'd like to scope on another project you can use that. However, I will be giving you an example project to work with. You need Xilinx Vivado to run this example project.

- Headphones

Step 2: Open Waveforms 2015

Open Waveforms 2015. You should see this window if the Analog Discovery is not plugged into your computer.

Step 3: Plug in Your Analog Discovery 2

Plug in your Analog Discovery using one of the USB A to USB Micro B Cables. You should see the Analog Discovery appear in the devices list as shown in the image in this step.

Step 4: Open the Logic Analyzer

On the left panel click the button that says logic to open the Logic Analyzer. It should be the 5th button down.

Step 5: Add a Digital I/O Signal

Click the green plus to add a signal. First I'll show you how to add a general Digital I/O signal. Click on signal to add a Digital I/O signal.

Step 6: Repeat Two More Times

Repeat two more times for a total of 3 Digital I/O signals.

Step 7: Add a SPI Channel

Now add a SPI Channel

Click the same green plus, but this time instead of clicking signal, click SPI.

Step 8: Change the Settings to Match the Test Design

Change the settings on the SPI channel. The settings above match the SPI demo that I will be using. These settings are important to make sure that the SPI data is interpreted correctly.

Step 9: Open the Test Project and Program Your Board

Download, Extract and Open the SPI Project in this step.

Generate the bit file and program the Basys 3.

Step 10: Plug Three 6 Pin Headers Into a Breadboard

Take three 6 pin headers and plug them into your breadboard as shown.

Step 11: Plug One Pmod Cable Into the Breadboard

Plug one Pmod cable into the breadboard as shown. Pay close attention to the placement of the star.

Step 12: Plug the Other End Into the PmodMIC3

Plug the other end of that Pmod cable into the PmodMIC3, paying close attention to the location of the star.

Step 13: Plug the Second Pmod Cable Into the Breadboard

Plug the second Pmod cable into the breadboard making sure the star is in the same location as the first Pmod cable.

Step 14: Plug the Other End Into the Basys 3

Plug the other end of the Pmod cable into the Basys 3 paying close attention to the location of the star. If it was on pin one of the PmodMIC3 it needs to be on Pin 1 of the Basys 3.

The PmodMIC 3 will be our master and the Basys 3 will be our slave.

Step 15: Plug Three of the Digital I/O Wires Into on the 6 Pin Headers

Take Digital I/O wires 0, 1 and 2 and plug them into the last Pmod header as shown. These will scope Data, CS, and SCLK.

Step 16: Your Entire Set Up Should Look Like This

Once put together, this is what your set up should look like.

Step 17: Change the Chip Select to Falling Edge Triggered

Right click on the X by the CS signal and change it to Falling Edge triggered.

Step 18: View Your Logic Signals

Now you can press run, or single and view your logic signals. Run will show the signals in real time, and single will take a snapshot of the signals.

Notice as you talk you can see the value that the SPI channels shows changing.

If you plug the PmodAMP2 into the top of Pmod port A, and plug in your headphones, you can hear the output as well.

To read more about my experience read this blog post.

Comments

author
abduljalil made it!(author)2016-02-18

Thanks for these useful information