====== what ====== A completely open design for a function/waveform generator: hardware, firmware, software for more info, read about [[start|openbench]] For collected links, try [[http://del.icio.us/ladyada/dds|DDS link on delicious]] and [[http://del.icio.us/ladyada/fgen|Function Gen link on delicious]] ====== Notes & stuff ====== ===== Design constraints ===== One or two designs: Low cost, high cost. * Low cost is ~$50-75 * High cost is ~$100-150 Waveforms we want (in order of importance) * Sine wave * Square wave (with variable PWM) * Triangle wave (with variable PWM?) * Sawtooth (possibly a modification of triangle wave???) * Arbitrary waveform (sync, envelopes, etc) * Noise (white noise, pink noise, brown noise, etc) Modulation (in order of importance) * Sweep (actually is FM) * AM * FM Frequency range: * 1Hz to 100KHz required (must cover audio ranges) * DC to 10MHz is ideal (digital/analog ranges) Output capabilities: * 50ohm/inf impedance * 1mv to 10V amplitude * 0 to 10V DC offset * trigger output USB control? Serial control? Panel control? All of the above? Vpp? (+-12V is pretty 'standard') 100mA is not a bad current capability to shoot for PCB is doublesided, 10/10 rule Parts are DIP, thruhole or PLCC (preferred) SOIC, 1206 (likely). No TSSOP, QFP, LLP, MSOP, uSOIC, etc. ===== Waveform generation ===== Waveforms we want (in order of importance) * Sine wave * Square wave (with variable PWM) * Triangle wave (with variable PWM?) * Sawtooth (possibly a modification of triangle wave???) * Arbitrary waveform (sync, envelopes, etc) * Noise (white noise, pink noise, brown noise, etc) Frequency range: * 1Hz to 100KHz required (must cover audio ranges) * DC to 10MHz is ideal (digital/analog ranges) ==== Generator tech ==== Two options for chip 'styles' is the all-in-one oscillator (ICL3038, etc) +PLL or DDS === Oscillators === All-in-one is nice, although not very stable w/o PLL. Two options available, MAX038 & XR220. * The [[http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257|MAX038]] is completely unavailable. * And the [[http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=34972|XR2206]] kinda sucks. Pros: easy, cheap, simple Cons: unavailable, PLL required === DDS === Direct-Digital-Synthesis, currently popular. Basically: wavetable + 24 or 32 bit adder and sampling above nyquist to get precision waveforms. * Pros: digital, precise, no PLL needed * Cons: hard to get high frequencies because of oversampling Either roll your own or buy off the shelf ([[http://www.analog.com/en/subCat/0,2879,770%255F843%255F0%255F%255F0%255F,00.html|basically from AD]]) == Off the shelf, AD parts == They come with sync out, very very high speeds. But only sine and square out, and in small packages (TSSOP). == Roll your own == **Idea #1**: Get a chunk of SRAM (like, say, CY7C1399B-12VXC), fill it with your wavetable, then clock it with a variable clock ([[http://www.linear.com/pc/productDetail.do?navId=H0,C1,C1010,C1096,P2415|LTC6903]] 1KHz->68MHz !!) maybe use along with adder/scaler to provide more range at high/low freq. We could get up to 4MHz, nice! * Pros: high frequency range * Cons: complex, lots of glue and fiddling, but might be a good solution **Idea #2**: SRAM + 32 bit adder, just like AD. Maybe make the adder in a CPLD or something else that can be clocked super-fast (See [[http://elm-chan.org/works/asg/report_e.html|ELM's DDS generator]]) * Pros: the ideal solution: high resolution, high speed * Cons: ugh CPLD, dont even know if there's a good solution available for the price/package we need, a little pricey Look at: http://www.rotgradpsi.de/mc/fg/fg.html , a handmade adder For CPLD, 100MHz PLCC (44 or 68) either XC9500 (xilinx) or MAX7000 (altera) **Idea #3**: Hand-roll the adder code into an AVR microcontroller, and use onboard memory. Lots of examples: [[http://www.scienceprog.com/avr-dds-signal-generator-in-line-asm-explained/|AVR generator]] or [[http://www.myplace.nu/avr/minidds/index.htm|Jesper miniDDS]] (note: can't we do this in 8 cycles by using LD? just make sure we have an AVR with more than 256b of RAM) * Pros: ultra-cheap/simple * Cons: 8 @ 20MHz -> low frequency output (20M/16samples/8cycles = ~150KHz), 8bit resolution Other possibilities include going with an SX instead of AVR: SX28 can be clocked up to 75MIPS (maybe give us 500KHz...but will draw an insane 100mA from 5V. jesus!) **Idea #4**: A combination of idea #1 and idea #3. Take a simple AVR that is able to calculate waveforms, but not in realtime. Load the wavetable in some external RAM, and clock it at the desired speed. * Pros: high frequency, adjustable waveform * Cons: complex ===== Power supply ===== Need 3.3V (probably), 5V, +-12V (@100mA) **Idea #1** Use 'computer' power supply: $5-$10! * Pros: cheap, safe, pretty good quality, universal, big * Cons: need to load down 5V - should look into this **Idea #2** Use 78xx's with mains transformer. * Pros: well understood, cheap, safe (isolated), clean power, huge * Cons: Transformers kind of a pain, unsafe (to build, wiring mains yuk) **Idea #3** Use a regulated power supply/wall wart with multiple outputs (see [[http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=154624|Jameco#154624]] 5V @0.5A +-12V @0.13A each $13) * Pros: Reasonably well priced, regulated, clean power * Cons: 'One offs' might be hard to find power supplies for later **Idea #4** DC/DC converters, run off of 'single' supply like 5V or 9VDC * Pros: simple, regulated, ultra compact * Cons: expensive, noisy **Idea #4b** Build your own DC/DC converter, a bit like [[http://spritesmods.com/?art=ucboost&page=2|sprite_tm]] did. Have the processor generate the PWM needed for the converter. * Pros: cheap, same as idea #4 * Cons: noisy ====== Planned versions ====== ===== Inexpensive kit ===== ==== Power ==== USB and/or external power (9VDC) Single output, +12V max (maybe -12V too). Boost converter: LT1610 will give +12V @ 1.2MHz switching freq. Has 8V max input so must clamp input. ugh. For isolation, use wall wart that provides 5->9VDC ==== UI ==== 2x16 LCD and some buttons & rotary encoders for UI. Maybe an 'm88? at 12MHz does the UI work and USB nonsense. (USB "serial" (or raw) interface using USBtiny.) and sends just raw serial/spi commands to DDS chipset ==== Chipset ==== DDS done by dedicated chip probaby Atmega48 running @ 20MHz DAC is DAC0800 (?)