This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
openbench:fgen [2007/04/13 03:59] ladyada created |
openbench:fgen [2007/12/03 16:36] geekabit |
||
---|---|---|---|
Line 2: | Line 2: | ||
A completely open design for a function/waveform generator: hardware, firmware, software | A completely open design for a function/waveform generator: hardware, firmware, software | ||
- | for more info, read about [[OpenBench]] | + | 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 ====== | ====== Notes & stuff ====== | ||
+ | |||
===== Design constraints ===== | ===== Design constraints ===== | ||
Line 15: | Line 18: | ||
* Sine wave | * Sine wave | ||
* Square wave (with variable PWM) | * Square wave (with variable PWM) | ||
- | * Triangle wave | + | * Triangle wave (with variable PWM?) |
* Sawtooth (possibly a modification of triangle wave???) | * Sawtooth (possibly a modification of triangle wave???) | ||
- | * arbitrary waveform (sync, envelopes, etc) | + | * Arbitrary waveform (sync, envelopes, etc) |
Frequency range: | Frequency range: | ||
* 1 Hz -> 100 KHz required (must cover audio ranges) | * 1 Hz -> 100 KHz required (must cover audio ranges) | ||
* 1mHz -> 10MHz is ideal (digital/analog ranges) | * 1mHz -> 10MHz is ideal (digital/analog ranges) | ||
+ | |||
+ | Output capabilities: | ||
+ | * 50 ohm/inf impedance | ||
+ | * 1mv -> 10V amplitude | ||
+ | * 0 -> 10V DC offset | ||
+ | * trigger output | ||
USB control? Panel control? Both? | USB control? Panel control? Both? | ||
Line 28: | Line 37: | ||
100mA is not a bad current capability to shoot for | 100mA is not a bad current capability to shoot for | ||
- | |||
- | 50 ohm/inf impedance? | ||
PCB is doublesided, 10/10 rule | PCB is doublesided, 10/10 rule | ||
Line 48: | Line 55: | ||
* 100 KHz or higher (must cover audio ranges) | * 100 KHz or higher (must cover audio ranges) | ||
* 1mHz -> 10MHz is ideal (digital/analog ranges) | * 1mHz -> 10MHz is ideal (digital/analog ranges) | ||
+ | |||
Line 72: | Line 80: | ||
Direct-Digital-Synthesis, currently popular. Basically: wavetable + 24 or 32 bit adder and sampling above nyquist to get precision waveforms. | 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 | * Pros: digital, precise, no PLL needed | ||
* Cons: hard to get high frequencies because of oversampling | * Cons: hard to get high frequencies because of oversampling | ||
Line 96: | Line 103: | ||
For CPLD, 100MHz PLCC (44 or 68) either XC9500 (xilinx) or MAX7000 (altera) | 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/|9 Cycles of ASM w/LPM]] (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) | + | **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 | * Pros: ultra-cheap/simple | ||
* Cons: 8 @ 20MHz -> low frequency output (20M/16samples/8cycles = ~150KHz), 8bit resolution | * 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!) | 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 | ||
Line 121: | Line 132: | ||
* Pros: simple, regulated, ultra compact | * Pros: simple, regulated, ultra compact | ||
* Cons: expensive, noisy | * 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 (?) |