Using the Analog Discovery to Debug Digital Logic

by Commanderfranz in Circuits > Electronics

8125 Views, 21 Favorites, 0 Comments

Using the Analog Discovery to Debug Digital Logic

cover.png

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.

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

Open Waveforms 2015

1 open waveforms no device attached.JPG

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

Plug in Your Analog Discovery 2

2 - plug in discovery.JPG

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.

Open the Logic Analyzer

3 waveforms.JPG

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

Add a Digital I/O Signal

4 logic analyzer.JPG
6 individual signal.png

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.

Repeat Two More Times

9 signals.JPG

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

Add a SPI Channel

5 spi bus.png

Now add a SPI Channel

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

Change the Settings to Match the Test Design

spi parameters.JPG

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.

Open the Test Project and Program Your Board

8 open spi demo and program board.JPG

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

Generate the bit file and program the Basys 3.

Plug Three 6 Pin Headers Into a Breadboard

56c6073745bcebb3d3001139.jpeg

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

Plug One Pmod Cable Into the Breadboard

56c607ae937ddb1b5f000f6c.jpeg

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

Plug the Other End Into the PmodMIC3

56c607db50e1b60d4a0004c5.jpeg

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

Plug the Second Pmod Cable Into the Breadboard

56c6080450e1b652e000011e.jpeg

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

Plug the Other End Into the Basys 3

56c607d745bcebb3d3001140.jpeg

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.

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

56c608594936d4ac9900070b.jpeg

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.

Your Entire Set Up Should Look Like This

56c6088567400cc0d3000678.jpeg

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

Change the Chip Select to Falling Edge Triggered

trigger on falling.png

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

View Your Logic Signals

12 zoom out and run.JPG

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.