Using the Analog Discovery To Debug Logic Circuits

5

Last week, Bobby shared his experiences getting back into FPGAs. Having once been a beginner with FPGAs and then being a TA in an intro to FPGA class, I can say that this is a pretty common struggle.

Bobby also shared some of the resources he found helpful, as well as some tips to increase success. After reading his post it occurred to me what helped me immensely throughout my journey, a tool I had throughout my entire intro to FPGA class but didn’t realize could have helped me until my second FPGA class, the Analog Discovery and Analog Discovery 2.

Analog Discovery 2-comp-600

The Analog Discovery and Analog Discovery 2.

For an entire year, I had no idea what the Analog Discovery and Waveforms 2015 were capable of when it comes to digital logic design.

I quickly recognized all the fly-wires (or the pin-out on the Analog Discovery) that I knew from my analog circuits classes. The waveform generators, ground, oscilloscopes, and power supplies — they’re all there! If you look to the right of those, there is a whole set of fly-wires that I wasn’t familiar with. Well, those are the digital inputs.

linout

The Analog Discovery pin-out diagram. Notice the digital inputs on the right.

Waveforms 2015 contains a tool called the logic analyzer. This allows you to view the digital signals being sent out of your FPGA in real time. This way you can see if what you think you are sending, is what you are actually sending.

Due to an unfortunate combination of illness and procrastination, I had to finish most of my EE324 (Digital Logic Circuits 2) labs in a period of about two weeks. I can tell you, that without the Analog Discovery and Logic Analyzer, I would not have been able to accomplish such a feat.

About a week or so in, I was in the lab, probably around one in the morning working on my SPI controller. Despite thinking that my SPI controller was working, nothing was coming out of the PmodMIC3. Imagine my frustration, and concern. Not a great combination for clear thinking.

Luckily, one of my friends who happened to be in the lab late (it happens more often than you would think) had an Analog Discovery, and suggested that I scope my signals.

So, I plugged in the Analog Discovery’s digital inputs to MISO, SCLK, and CS. Imagine my shock when I discovered that SCLK wasn’t outputting anything. I probably wouldn’t have discovered this nearly as quickly without seeing the output live.

I looked back at my code and discovered that I had set SCLK to an input rather than an output. I know, a total “facepalm moment”, but give me a break! it was one in the morning.

So, I changed that pin to an output, and it worked perfectly! The Analog Discovery’s logic analyzer saved the day.

cover

A shot from Waveforms 2015 showing the SPI signals.

Imagine how much faster I could have fixed my other projects if I had known all along. I wanted to share this experience with all of you who follow the blog to hopefully save someone else some frustration.

To learn how to use the logic analyzer, check out my Instructable on using the logic analyzer on the Analog Discovery 2. To learn more about the Analog Discovery 2 or Waveforms 2015 themselves, check out their respective resource centers.

Share on FacebookTweet about this on TwitterShare on Google+Pin on PinterestShare on RedditShare on TumblrShare on LinkedInShare on StumbleUponEmail this to someone
Share.

About Author

5 Comments

  1. M. Z. Aziz Khan on

    I wonder how would Analog Discovery 2 would become more useful if it is added with the feature of current measurement… I read that the National Instrument MyDaq is now available on Digilent store. It can work as Ammeter too…
    So I think it will make Analog Discovery 2 be more powerful device with current measurement capability. what about the I-V characteristic plots. Although it can still draw them using XY draw function and using some external resistor and then Ohm’s Law. But would it be more easy and precise to be able to draw I-V characteristic directly for device under test.

    What do you all think, please comment 🙂

  2. Emmanuel Clarke on

    The Analog Discovery 2 is currently on my wish list. This device is Epic! It has a Oscilloscope, Logic Analyzer and Variable Power Supply built right in. It connects to your computer via USB so it can be used virtually anywhere. The Analog Discovery is half of my Electronics Lab equipment in one device. I can think of hundreds of uses and the implementation with an FPGA in the example given in this blog post is a perfect one! The Waveforms 2015 software also a great addition and the graphical user interface is intuitive to use.

  3. Can Waveform2015 be set to show values in mA instead of mV? I know that most bench scopes can be set that way, so you can just add the resistors and are done (provided the scaling is correct).

  4. The Analog Discovery is also fantastic for scoping microcontroller projects, I use it all time. The logic analyzer is great for viewing and interpreting common communication protocols, do you know if there are any plans to add the ability to easily send test data via protocols such as I2C, SPI, and UART? This would be super handy for testing new sensors, sending data to a microcontroller/FPGA, etc.

Leave A Reply