|For novel ideas about building embedded systems (both hardware and firmware), join the 40,000+ engineers who subscribe to The Embedded Muse, a free biweekly newsletter. The Muse has no hype and no vendor PR. Click here to subscribe.
Episode 16: A Cheap Signal Generator Is Better Than its $50 Price
August 24, 2015
(Go to the complete list of videos)
I bought this DDS signal generator off of eBay for $50 (new). It shipped from China. This is my review of the unit.
Hi, I'm Jack Ganssle and welcome to The Embedded Muse video blog, which is a companion to my free online e-newsletter. Today, we are going to take a quick look at one of those really cheap signal generators that you can buy on eBbay.
You can see it's a very simple thing. It's a nice front panel. There's no case at all. There's just an exposed printed circuit board on the back. It's powered from a wall wart and there is no on-off switch. You just unplug it from the wall to turn it off.
The thing will generate sine, square, and triangle waves from any frequency from 0 up to 10 megahertz. Ten megahertz, of course, is pretty slow. If you're working with signal generators, often times we're up in the much higher frequencies. But let's think about a digitally synthesized 10 megahertz because indeed, that's what we're dealing with.
That means each cycle is 100 nanoseconds. If you're trying to replicate say, a nice looking sign wave, you need a lot of data points within that 100 nanoseconds. Eight bits might not be unusual. That's 256 data points. That means you have to output a new value every half a nanosecond. That's far too fast for a CPU to do.
Looking more closely at the guts of the thing, it's basically a one-sided circuit board. All the components are on this side of the board and right here is what appears to be a processor. I can't identify it. It looks to me like it's probably a Chinese cortex M0, but I can't say for sure. This is an Altera FPGA and that FPGA generates the waveform out of these pins here, which are fed into this, what is called an R2R network. It's a network of resistors.
So how does the thing perform? Let's check it out. The controls are pretty decent actually. The select switch menu worked the way we want it to be. And then with this button, we can select sign, square, or triangle waveforms. All these buttons are very snappy. They actually have a very nice action to them. There's an amplitude adjustment and waveform offset adjustment. These are both potentiometers. And this sets the frequency, so if I go to here, I can set the frequency just by turning this.
It has nice detents. I'm sure it's an encoder of some sort. If I select a square wave, then I can also select the duty cycle of that square wave. Here it's at 50%. Give us a nice symmetrical square, but you can set that to any number from 1 to 99%, and we'll see how that behaves shortly.
Fitting the sine wave into my trusty Agilent oscilloscope, you can see it looks really nice. And I can vary the amplitude, vary the offset. We'll look at that more in a little bit, and of course, frequency as well. As you can see here, I'm the max, 10 megahertz. It's a pretty darn good-looking sine wave. And it maintains pretty good shape regardless of what frequency I set the thing to.
If I step through the different kinds of waveforms, here we have a nice 500-kilohertz sine wave. It gives a pretty decent looking square wave, but if we look a little closer, you're going to find if I crank up the rise time and the fall time, you can see that the rise and fall time is actually fairly slow. It works out to about 35 to 40 nanoseconds depending upon what the settings of the generator are. But it looks halfway decent there. Here's a triangle wave, which again, looks very, very nice.
Let's go back to the square wave, though. Things get interesting as the frequency goes up. Here I am at one megahertz. Look how the waveform is bouncing around. That only seems to start happening at 600 kilohertz and above, so low-frequency square waves look pretty decent. But at high frequencies, there's this very strange oscillation, which makes absolutely no sense to me.
I did mention that there was a fairly slow rise time, and we see that becomes a significant problem as waveforms increase in frequency. Here we have what is supposed to be a square wave at 7 megahertz, go all the way up to 10, and you see it's got all kind of distortion in it. There's a low-frequency distortion you can see riding on top of it as well as the square wave looks a whole lot more like a sine wave. And that's entirely due to the slow rise and fall times.
If I go back to 500 kilohertz, we get a decent looking square wave again. We can vary the duty cycle. Again, I'm at 50% now. If I decrease that, we can see that I can make pulse shapes of pretty much any kind of pulse that I want. Again, they're far from perfect. You can see this funny bouncing around artifacts starting to happen, and that we are still dealing with slow rise and fall times. But it's at least nice to be able to get some kind of a pulse out of the thing.
Here I've connected the output to the TTL output from the signal generator. In other words, it's both an analog channel, which is what we've been looking at and one which is pure digital. You can see we still have this funny bouncing around artifact, but the rise and fall times get a whole lot better. You get to about eight to nine nanoseconds.
Going back to the analog output, here is a sign wave again. Again, a 500-kilohertz sign wave, let's play a little bit with the offset control of this signal generator. You can see we can move this up and down. Zero volts is here, so we can get a truly going negative and positive. But, as you can see, as you get near the extremes, the output amplifier is saturating. Negative, we see that it's saturating again. Let's turn the trigger down, and you can see it's starting to clip pretty badly.
The moral here is if you're using this device, you really need to us an oscilloscope to understand what the waveform actually looks like. Going back to the device, you can see that now I'm connected to the input for the frequency counter. And indeed, it's displaying the frequency of a square wave that I'm feeding into it and, as you can, see it's changing as I change that frequency. It's actually pretty nice, and I've measured. It's fairly accurate.
So much for the basic measurements. What about something more interesting like spectral purity? On the oscilloscope, the sign wave looks beautiful. But are there any other components in it? For that, we're going to turn to my spectrum analyzer.
So you can see the signal generator is generating 10 megahertz sine wave which, as we zoom in, you can see is a perfect spike on a spectrum analyzer as you might expect. But with this little DDS signal generator connected also at 10 megahertz, you see the perfect spike right at the 10 megahertz center frequency but also harmonics at either side indicating a spectral purity that really isn't there. Of course, the harmonics are about 40 decibels down from the fundamental, so they're really not that important.
Now, every other digitally synthesized signal generator I've looked at has some harmonics somewhere because it is digital. It's hard to avoid that. And on this unit, they're actually pretty darn low. And they're low enough that it's not going to be a problem for the vast majority of applications.
So, there you have it. For 50 bucks, you really can't knock the thing. It's 10 megahertz, which isn't real fast. Square waves get distorted at higher frequencies. There are some issues with the offsets but, all in all, for the price, it's a really nice little unit.
Thanks for watching and be sure to go to the website, www.ganssle.com, for thousands of other articles and information about the fun world of building embedded systems.