Decoding VGA Signals With a Portable Logic Analyzer

by Commanderfranz in Circuits > Tools

5276 Views, 21 Favorites, 0 Comments

Decoding VGA Signals With a Portable Logic Analyzer

17692243_1376820012338165_611448866_o.jpg

Logic Analyzers are useful tools for viewing, understanding, and decoding digital logic signals. Many allow you to decode common communication protocols, and even communicate with these protocols via a protocol analyzer.

Logic analyzers also come in a variety of sizes, prices and speeds. With the release of the Digital Discovery from Digilent, you can now get a logic analyzer, with sample rates up to 800MS/s for around $250.

This opens up the use of logic analyzers to many more applications. With the Digital Discovery specifically, comes WaveForms 2015 the software that runs the device. With it you can do all the normal functionality of a logic analyzer, and write scripts to decode interfaces that are not automatically included.

In this instructable, I'll use the Digital Discovery + High Speed Adapter to decode a VGA signal into an image. This can be useful when working on a VGA project, to see what signals are being sent correctly or incorrectly, and how they affect the final image. In the logic analyzer window you'll be able to see the VGA signals, and the script will save the resulting image.

What You'll Need

Here are all the items you'll need:

- Logic Analyzer with Scripting

In order to complete this project you'll need a portable logic analyzer with sample rates up to 400MS/s and scripting capabilities. I choose the Digital Discovery with the High Speed Adapter. This can reach sample rates up to 800MS/s which is more than enough. It also has a scripting interface that gives access to write scripts using the logic analyzer. Below are all the individual components:

- Digital Discovery

- High Speed Adapter and Cables

- Breadboard

- Associated software

- The Digital Discovery comes with WaveForms 2015 which is free to download. It also allowed me to save the configuration as a WaveForms project so all you have to do is download that and open it. Everything will be configured and the script will be loaded.

- VGA Project

You'll also need a VGA project where the VGA signals included HS, VS, and the 4 bits of all RGB signals are outputted to external pins. The script is currently written for 25MHz pixel frequency, and 480x640 resolution. I used a game of tic tac toe written by GitHub user verdoss, and modified it to output the VGA signals to the Pmod ports on the Nexys 4.

- An image viewer that can open ppm file types.

The script outputs a ppm file, so you'll need something that can open that. I used Ifranview.

You can see my setup with all of the components in the first step.

Download the WaveForms 2015 Workspace

logic analyzer data.PNG

Once you get your VGA project up and running, the first thing you'll need to do is download the WaveForms 2015 workspace. This has the logic analyzer open with the correct acquisition settings for a standard VGA spec, the power supply interface set to interprate 3.3V as logic high, and the script editor open with the correct script.

Once it's downloaded, double click to open it.

Then you'll want to run the logic analyzer to capture your data. It will automatically load with my data. Make sure that the window captures on window of data, i.e. the data between to vertical sync windows.

Note: If you don't have the Digital Discovery, you can download WaveForms 2015 and open this interface in DDiscovery Demo mode.

Downloads

Plug the High Speed Adapter Into the Digital Discovery

17693059_1376820092338157_407951097_o.jpg

Next you'll need to setup the hardware.

Plug the High Speed Adapter into the Digital Discovery, and connect 14 High Speed Logic Probes to DIO 0,1, and 4-15.

Ground the High Speed Logic Probes

17622175_1376820062338160_1687477758_o.jpg

The High Speed Logic Probes reduce noise by grounding each signal, and including a terminating resistor.

Using the breadboard plug all of the black ends of the High Speed Logic Probes into the same node, and connect that same node to your projects ground. In my case I connected this node to the ground pin on one of the Pmod ports.

Connect the High Speed Logic Probes to the VGA Signals

17622201_1376820045671495_300132451_o.jpg
Capture.PNG

Connect the red side of the High Speed Logic Probes to the VGA signals of your project. For me that meant connecting them to the pins on the Pmod ports that I had sent the VGA signals to.

You can see which DIO pins correspond to which VGA pins in the image of the logic analyzer signals I've attached to this step.

Double Check That Everything Is Connected Correctly

17668931_1376820089004824_469290035_o.jpg

I always skip this step and I always regret it.

If you are using the same setup as me and you see noise in the horizontal sync or vertical sync signals, something isn't grounded properly, or you have a faulty breadboard wire. I had both of these problems I had to fix.

Run the Script

script.PNG
Digital Discovery vga demo

Next go to the scripting interface and run the script. You can see a video of me running the script in this step. It will take a few moments to run, and will be done when the stop button turns back into the run button.

Open the Resulting Image

17670534_1376820009004832_1842200244_o.jpg
img.jpg

Next you can open the resulting image. The script saves the image to the desktop as img.ppm. I converted this image to a type that instructables recognizes so it can be easily viewed.

You can see that the image that is saved is actually a negative of the original image. You can fix this if you want, but I thought it was pretty neat.

For more uses for the Logic Analyzer on the Digital Discovery, you can check out the tutorials and community projects on the resource center. And of course, follow the Digilent blog for more neat and useful projects.

Downloads