Background

I've wanted to build a PC oscilloscope for a long time. When I worked a consultant, I often had my trusty Tektronix TDS 220 with me in my backpack to customers, but it is a bit cumbersome to carry around even though it is one of the lightest and smallest scopes you can find. So I really would like to have a small PC scope that I can control from my laptop instead.

The specifications of most PC oscilloscopes on the market are rather underwhelming though; the best do have an analog bandwidth of 100MHz but the sampling rate is usually not more than 25 or maybe 40MSamples/s. After getting used to my Tek scope with 100MHz analog bandwidth and 1GSamples/s I really do not want to switch to a scope with much worse performance.

Most of the stuff I need a scope for are external buses, such as a SPI port running at up to 50MHz. So 100MHz analog bandwidth is probably enough, but I'd like at least a couple of times of oversampling, so 200MSamples/s is a minimum. A would also like a scope with really deep memory, it's wonderful to be able to zoom into a waveform on the Agilent scope we have at work, something that my old Tek scope can't do. The Agilent scope at work has 2MSamples of memory, but more would be nice, sometimes when I look at a 10MHz data bus it would be nice to be able to record maybe a second worth of data and still be able to zoom in and see the individual bit transitions.

So, the last few years I have been reading about DIY oscilloscopes on the web and toying with the idea of building one myself, and I finally did get around to it, and this page describes what I've done.

Actually, Agilent has recently (in 2008) released a PC scope which fulfils my requirements, the U2701A with 100MHz analog bandwidth and 1GSamples/s sampling rate (if you interleave both channels), and at an affordable price at that (about EUR 1000). But when I discovered this I had already been working on my own scope for some time.

Designing the hardware

First of all, a short description of how a digital oscilloscope works.

Well, here is where it gets tricky. I'm a software programmer, and I really do not know what I'm doing. I've built some fairly simple digital designs before, but they have been running at moderate frequencies, so I've been able to treat them as all digital and haven't had to think about all the nasty analog stuff. What I'm planning to do now is to build a mostly analog board which has to be able to handle 100MHz and with very little noise. Uh-oh. But I'm doing this to learn about analog design and logic programming in Verilog, so what's better than a little challenge?

I wanted to use an off the shelf FPGA board for the digital signal processing and storage. the FPGA board should also have some way of communicating with a PC. I've looked at things such as the USB connected boards from Opal Kelly, but finally purchased a  Xilinx Spartan-3A DSP 1800A XtremeDSP Starter Platform. This board has a FPGA with loads of gates and some built in multipliers, perfect for signal processing. It also has loads of RAM (128MByte) and a gigabit ethernet port. It also has an expansion connector following the  Avnet EXP specification which can be used to connect to the A/D converter. There are also a few other boards available with the same connector, so it should be possible to switch to a different board in the future if I want to.

So, after deciding to use a board the the Avnet EXP connector, I started work on a board with the analog input stage and the A/D converter. My goal to build something with 100MHz analog bandwith, and an as cheap A/D converter as possible which manages at least 200MSamples/s at 8 bits per sample.

This is the analog hardware design I came up with.

Results

All design files, the Gerber and Excellon outputs and some other images can be found in my subversion repository. Note that the all the component values in the schematics are not correct, I wanted to send off the Gerber files as quickly as possible.

source:/scope/pcb/tags/20081203/board.png

At the beginning of December 2008 I finally mailed some gerber files to  Olimex for manufacturing and on Monday December 29 I got the PCBs back (Olimex had a lot of holidays during December and the Swedish mail delivery is very slow during the holidays). The board is 100x80mm, the maximum size possible with the freeware version of Eagle:

source:/scope/pcb/tags/20081203/pcb-top-small.jpg source:/scope/pcb/tags/20081203/pcb-bot-small.jpg

Here's a page about assembling and testing the hardware.

FPGA

For the FPGA, I haven't really started yet. The basic idea is to have one functional block that receives samples from the A/D converter and continually stores the samples into SDRAM. The FPGA also monitors the incoming samples for something that matches the trigger that has been configured; when that happens, it saves away a trigger time stamp and raises an interrupt. The interrupt wakes up a different functional block which copies the samples around the trigger point together with the trigger time stamp into a UDP packet which is then transmitted to the PC.

Bugs

I have discovered a couple of bugs of course:

#7
C16 and C73 have the wrong polarity
#8
The center pin of the SMA connector is too small
#9
A/D converter has no overvoltage protection
#10
The voltage reference DA gives strange outputs
#11
Voltage reference is very noisy

Thanks

Thanks goes to Johann Glaser for putting his oscilloscope design on the web, without it I wouldn't have been able to do this. Big thanks to Analog Devices, Texas Instruments, ON Semiconductor and Samtec that provided free samples. And I'm really happy with Digi-Key where I purchased a lot of the other components I needed, very convenient and fast delivery.