EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: martinjaymckee on September 28, 2018, 06:27:06 am
-
So, I'm toying with some wave gen ideas. Particularly I want to build up something to test a couple of old Tek scopes I've acquired. Mostly what I'm looking for is a source that will allow me to do simple calibration, similar to what is outlined in the service manuals. For that, I'll need a pulse generator and sine output with reasonable frequency and amplitude accuracy. I'm not looking for insane speed -- 1MHz bandwidth would be sufficient, I think.
What I am thinking at the moment is a computer connected board (USB) with a moderately powerful microcontroller and a quad DAC. Here are the basic specs I'm hoping to meet.
1. Three (or four) output channels
2. Minimum >1MHz sine bandwidth, >20MHz square wave
3. Software based DDS and AWG
4. Output voltage range of [-5v, 5v]
5. 50 ohm output impedance
6. *potentially chainable so that the configuration connection and clock reference can be used by multiple boards.
While it would be fun to have a display, I don't feel that I really need one. It would be easy enough to just use it connected to a computer. A bluetooth connection to allow me to use it with my tablet would be fun also, though unnecessary. The idea originally was to make it able to create signals for chaotic attractors like Chua's Circuit. Primarily, I want to be able to test X-Y mode along with the Z input.
I don't actually have a function generator. As such, I want to be able to do some "normal" function gen stuff with this board. I know that I'll run into bandwidth limitations regardless of what it is if I'm doing DDS on a micro. So, that's not something I'm too inclined to worry about. This definitely qualifies as a "fun" project and I'm not wanting to spend loads of money on it. My initial BOM includes:
1. NXP LPC4370 Tri-Core (M4/M0/M0) Microcontroller
2. Maxim MAX5715 12-bit Quad DAC
3. whatever else I need to cobble this together
Any ideas, suggestions or concerns? Anyone else who's done something similar?
Cheers,
Martin Jay McKee
-
Martin, welcome to the forum. Your sig does not say what country you are from, something that is very helpful for people to know when making recommendations to you. In the US analog function generators go very cheap on ebay, often under $50 shipped, I paid $25 for mine, a 10Mhz WaveTek. I am all for learning by building equipment, but I like to have a basic working unit for reference first.
-
I'll get that fixed up in my sig at some point, but yes. I'm in the US. I agree that having a reference is important and I was considering actually getting my hands on one of the inexpensive models (as you say, in the US they are very cheap). To be fair, I've actually got a single-channel function gen that I cobbled together last year just to test things (both how easy it would be to do and the first of the oscopes). More than anything, I'm wanting to come up with something that can generate at least three synchronized analog signals. With an external reference input, of course, I could probably hack something together with multiple single-channel models. Getting phase between the signals correct could be a challenge, however.
Cheers,
Martin Jay McKee
-
Martin, that's an ambitious project, I will be interested with what you come up with. Way out of my league. I have an Analog Discovery that has a very capable AWG (within V/C limits), but that is limited to 2 channels. This would seem a project for a MC.
-
I take it that you are aware that DDS will only give you stepped signals and that limitation is acceptable to your end use.
For us noobs, what is AWG, in this context? American Wire Gauge?;-)
-
Indeed, DDS gives a stepped waveform. That is fine for me, though I'm struggling to find a DAC that really gives me the "warm fuzzies" without breaking the bank. I would prefer to have 12-bit resolution with a settling time of 200ns or less. That gets expensive; it also gets rid of the jaggies. I've played with DDS before though, and for my purpose here, it'll be just fine.
I'm using AWG in the context of Arbitrary Waveform Generator (yes, the collision of initialisms is a pain). While it will be able to support sine, triangle, saw-tooth, pulse, etc. (with variable offset and phase). It should also be able to handle arbitrary waveforms stored in memory and also computed waveforms. To be honest, it's the computed waveforms that triggered me to start thinking about this project in the first place. A computed waveform may be something like a model of Chua's circuit or the Lorenz attractor. As I say, what I'm interested in using the multiple channels for is testing my old scopes in x-y mode with the external z (intensity) input. A good place to start with that is synchronized sine waves -- Lissajous figures are pretty cool. I've always been a sucker for chaos theory though. I've played with it on a computer plenty. I'd love to create a physical source of chaos. (By some definitions, I suppose I do that with most of my projects!)
Cheers,
Martin Jay McKee
-
In the process of playing with the idea some more today I hit on an interesting possibility. Analog Devices make some very nice DACs which work up to a high sample rate. Specifically, the pin-compatible AD970x series are 8-/10-/12-/14-bit DACs that work up to 175Msps. That would allow for generating a sine wave output up to at least 25MHz which is much higher than I had been targeting. Also, the 8-bit parts (AD9704) are under US$7.50 as singles from Digikey. That is perfectly reasonable from a price standpoint. The problem, of course, is how to generate 175 million samples per second for three different DACs. My original thought of using a microcontroller is completely untenable (I might be able to generate 5Msps using the LPC4300 series). The obvious solution is to use an FPGA. The problems with that are cost and complexity -- both things I wanted to avoid with this project. So, as I was looking for low-cost FPGA solutions, I came across the Digilent Cmod A7 boards. They are small breadboard friendly modules with Xilinx Artix-7 FPGA devices, a USB-USART interface and a JTAG programmer interface. It's a complete solution for FPGA development. At US$70 - US$80 (depending upon the mounted device) they are far from the least expensive modules I found. Nevertheless, they are some of the only pre-built modules I found with the Artix-7 series devices. The main advantage of the 7-series devices is that they have more advanced DSP blocks than the -3A or -6 series FPGAs; and, the low-end Artix-7 devices have 4x the DSP blocks of the low-end Spartan-7 devices. Anyway, the major limitation is the small number of pins which are broken out. The Cmod A7 only has 44 external digital pins. The concept, therefore, formed as is seen in the image.
The whole system would be built on a board into which the Cmod would be plugged. The 44 input pins would allow for controlling three 12-bit waveform generation DACs (there aren't enough pins for the 14-bit model) and controlling a single eight-channel (SPI connected) span/offset DAC. This span/offset DAC could be chosen from the TI DACx0508 family to be anywhere from 12-bit to 16-bit resolution. The use of the digital pins on the Cmod would then be:
- 36 (3 x 12) pins for waveform DAC data
- 4 (4 x 1) pins for SPI chip select
- 3 pins for SPI (SCK, MOSI, MISO)
That leaves only a single digital pin available, but it shouldn't be needed anyhow.
Because of its high sample rate, this would no longer be an easy design. It would, however, be able to do a heck of a lot more than I was originally thinking and it would get me back into working with Verilog... something I've wanted to do for some time. The lack of digital pins is sort of annoying though. It means that I couldn't put a display onto it or do anything, really, in addition to just producing the three signals. The two solutions to that are an I/O Expander or a "board controller" microcontroller (which, frankly, could be quite a powerful controller in its own right). The board controller could handle all of the external SPI connections which means that there would be up to 8 pins to connect the "board controller" to the FPGA. Since that could, potentially, be something like a QSPI interface, the memory bandwidth available could be substantial.
If I'm going through all this trouble (and expense) I certainly want to do things right. The output driver design will be critical to get anywhere near a true 12-bit resolution at the speeds this will be capable of. Moreover, it would make sense to put in a fairly sharp reconstruction filter at one-fifth the sample rate, or something. At these speeds, I would definitely want to target a 50 ohm output. The next step seems to be to figure out if such a driver is reasonable. Then I can work out a minimum testable design (with the lowest resolution devices) to see if it falls within my "financially" feasible range. I'm not too fussed though, I've got plenty of other projects to fall back on when I'm not sure about this.
The question is: how useful does this thing seem to be, once everything is up and running? Basically, it's a 25MHz (175Msps), three-channel function generator with arbitrary waveform capability and up to 12-bit resolution. The user interface would likely leave much to be desired as designed. So that's a concern (given the extra time, money and effort this will take beyond some of my earlier ideas).
It's a good thing I enjoy the design process.
Cheers,
Martin Jay McKee
-
Yep, I was going to suggest the Analog Devices frequency synths... I have looked at the AD9850&51. I put together a complete DDS kit, too long ago. I need to get it out and solder it up...
-
All About Circuits just sent me a link to a project AWG using the AD9833 DDS chip. I have not finished reading yet so nothing can offer other than a heads up for something that might be of interest to you. The chip is only about $10 so not too bad.
https://www.allaboutcircuits.com/projects/how-to-DIY-waveform-generator-analog-devices-ad9833-ATmega328p/?utm_source=All+About+Circuits+Members&utm_campaign=9eb72a38f5-EMAIL_CAMPAIGN_2018_09_28_02_08&utm_medium=email&utm_term=0_2565529c4b-9eb72a38f5-273001809/ (https://www.allaboutcircuits.com/projects/how-to-DIY-waveform-generator-analog-devices-ad9833-ATmega328p/?utm_source=All+About+Circuits+Members&utm_campaign=9eb72a38f5-EMAIL_CAMPAIGN_2018_09_28_02_08&utm_medium=email&utm_term=0_2565529c4b-9eb72a38f5-273001809/)
-
Analog oscilloscope calibration requires a time-marker signal to surprisingly high frequencies for horizontal linearity. DSOs can do without this.
Vertical calibration requires accurate signals from at least 4 millivolts to 20 volts peak-to-peak. Covering this range will be somewhere between difficult to impossible without some type of calibrated switched output stage. I have often thought however that analog sampling of the output signal (synchronous demodulation) could be used to produce an accurate output signal over this range with fewer or no switched output attenuators.
Another feature I would want is a high voltage clean output for checking probe compensation which might be combined with the amplitude calibration.
Transient response calibration requires a reference flat pulse which only depends on the output circuits and is usually an independent output. This should be a variable amplitude output up to at least 0.5 volts but 5 volts would be even better and is feasible.
-
I'd better catch up here...!
Firstly, I was originally thinking of using some of the Analog Devices DDS synthesizer devices. They easily handle the frequencies I would want, they are synchronization, and they are pretty simple to use. The AD9833 would limit the output to maybe 5MHz; but that's sufficient. The AD9850/AD9851 are much faster and would give around 25MHz, which is what I was expecting with my "design" above. The thing is, these DDS units are limited to sine wave generation. I'm really hoping to have not only waveform generation but (in fact) arbitrary waveforms. Going with the AD9102 would give a little more flexibility as it has built-in sine wave generation, sawtooth and triangle wave generation, pseudorandom generation, and some simple AWG functionality. It also has a 14-bit DAC, which would be very nice. They are almost US$25 a piece, so they aren't cheap. While the AD9102 would make for a very nice function gen (though I'd have to do squarewave generation separately) it wouldn't allow me to implement the calculated AWG I'd like to do.
@David Hess
Thanks for the thoughts on the oscilloscope calibration input. I must admit that I was rather concerned about the requirements for a full calibrator. I had remembered that the lower end was around 4mV p-p. I've not come up with an output stage design that would handle that nicely (as you say, without an attenuator).
I think the transient response calibration would be one of the easier features, though I wonder if I could fit it in to the above design. I'm running out of pins on the FPGA. I do, however, have two DACs free in the span/offset device, so I'd have a way to do variable amplitude.
I'll really have to give some thought to whether it is possible to put all of this into a single device in any reasonable way. Given what a good calibrator costs, it would be worth coming up with one myself. Maybe not along with the rest of this project though.
Finally, I looked back at the design and identified a couple of problems. I totally forgot that the DACs require an external clock. I should really generate that in the FPGA, so I look to be out of pins. I think that I should go ahead and change the wiring of the system so that the waveform DACs are connected directly to the FPGA for data and clock but to have the SPI connection to an ARM processor on the board. If I used the AD9706 DAC - the 12-bit version - and had a 3-channel unit, that would use 37 (3*12 + 1) bits for the wave generation and leave 7 bits for connecting the microcontroller to the FPGA. That would mean that I could use the quad SPI peripheral on the LPC4300 series microcontrollers to transfer data to/from the FPGA. It would be very fast that way. I haven't found a slave quad SPI IP core for the FPGA, however, so that'd probably be the first task... writing one.
As before, thanks very much for the input. I almost wish I didn't have other projects in flight right now. This one is getting progressively more interesting.
Cheers,
Martin Jay McKee
-
The sine wave output from a DDS will not be very useful except perhaps for SFDR (spurious free dynamic range) testing which is not typically done on oscilloscopes. Typical bandwidth tests are done with a much higher frequency leveled sine wave output.
A reference level fast rise or fall output can be done with a cascode transistor stage driven by a fast logic gate. The old Tektronix type 106 (http://w140.com/tekwiki/wiki/106) gives a rough example of how this can be done for calibration above 100 MHz. I would try using something like a 74LVC125 tri-state buffer operating at 5 volts to drive the emitter of a fast cascode transistor like a BFQ19. A more complex circuit will be needed for greater than 0.5 volt output (limited by the output current of a single gate) but that is sufficient for most applications.
If you want variable bipolar amplitude levels for the fast transient response output, then things get complicated and verification becomes a problem. Offhand I don't know of any designs which do this. At most, they have one polarity for each output which may have a variable level above or below ground.