Function Generator With Zero CPU Cycles

No one is sitting around their workbench trying to come up with the next great oscilloscope or multimeter, but function generators still remain one of the pieces of test equipment anyone – even someone with an Arduino starter pack – can build at home. Most of these function generators aren’t very good; you’re lucky if you can get a sine wave above the audio spectrum. [Bruce Land] had the idea to play around with DMA channels on a PIC32 and ended up with a function generator that uses zero CPU cycles. It’s perfect for a homebrew function generator build, or even a very cool audio synthesizer.

The main obstacles to generating a good sine wave at high frequencies are a high sample rate and an accurate DAC. For homebrew function generators, it’s usually the sample rate that’s terrible; it’s hard pushing bits out a port that fast. By using the DMA channel on a PIC32, [Bruce] can shove arbitrary waveforms out of the chip without using any CPU cycles. By writing a sine wave, or any other wave for that matter, to memory, the PIC32 will just spit them out and leave the CPU to do more important work.

[Bruce] was able to generate a great-looking sine wave up to 200 kHz, and the highest amplitude of the harmonics was about 40db below the fundamental up to 100 kHz. That’s a spectacular sine wave, and the perfect basis for a DIY function generator build.

Ask Hackaday: Who Wants To Build A Function Generator?

[tari] sent in a tip about a MAX5214 DAC evaluation board AVNET is giving away this summer.  The MAX5214 / MAX5216 is a neat little chip providing a 14 or 16 bit DAC with a serial interface in a tiny 8-pin package. [tari] thinks this eval board could be hacked into a function generator, and we’ve got to agree. Now, who wants to build one?

It’s entirely possible to take the MAX5214 chip and put it in a circuit with a small ARM uC, a display, and a few knobs, but that seems like a waste of time given function generators of this caliber are already available for about $60. It seems the most efficient hack of this dev board will be simply adding an amplifier to this board’s output and possibly programming a better interface than the current LabView software available.

If you want to tinker around with some free hardware and make something useful in the process, have a go at making a function generator out of this dev board. Be sure to send it in when you’re done.

Attiny25 Based Function Generator Causes A Wave

Function generators are a handy bench tool to have around, and while you can usually cobble something together that works, it is much more handy to grab a device when you need it. Thats where this function generator sent to us by [Mohonri]comes in. Based around a ATTiny25 and a rail to rail op amp which is able to replicate frequencies from 1Hz to about 40KHz, in square, triangle, and sinewaves simultaneously.

The function generator also features independent amplitude control on each output. And it’s all on one palm-sized, single-sided PCB. The main part of the code is split into two parts: the main loop gets the inputs and constructs a waveform table in SRAM, and then an ISR reads that table and outputs it to one of the timers, which produces a PWM output, which is low-pass-filtered and then passes through a potentiometer (for amplitude control) and then to an op-amp before landing on a set of terminals.

Though its not 100% perfect, trading speed for a 6 bit resolution, it should be more than enough for most electronic projects. You can pick it up in kit form from the on-line shop, but schematics, software and PCB layouts are also available for download.

Building A ’60s Guerilla Homebrew Square Wave Generator

What do you do when you’ve got three broken function generators? Build your own, obviously. Since your workshop has already gone through three of these bad boys, you might find yourself repairing your build. Better not use any fancy ICs and go with a transistor only build.

When [Miroslav] sent in his ‘guerilla homebrew’ square wave generator, we were really impressed. With a relatively simple schematic that uses parts that could be salvaged from old radios, this is a real MacGyver build.

The generator is based around a simple astable multivibrator. It doesn’t provide sine waves, but it’s the easiest circuit to get working. The build started off with a quartet of 2N4401 transistors, but according to the datasheet and the venerable Tektronix 502A, these had a very bad rise time compared to 2N3904s.

[Miroslav]’s project generates square waves up to 2.22 MHz and pulses with a variable duty cycle from 1-49% and 51-99%. Output is either 5 Volt TTL levels or an adjustable 0-3.38 level. The generator is exactly what [Miroslav] needed, so that makes it a great tool in our book.

Function Generator Built And Mounted Inside Electronics Bench

A function generator is a handy piece of test equipment to have on-site. [Kammenos] designed and built his own function generator, using the bench itself as the enclosure. You can see above that the control panel presents a clean finished look. To achieve it, [Kammenos] designed and printed the panel labels on a sheet of paper, and used a piece of acrylic to protect it. The circuit inside uses a MAX038 high-frequency generator chip. This is a full-featured part that allows for great control based on a few external components. One of those is a selectable frequency range based on the capacitance value on one pin. This is selectable using a twelve-step rotary switch with a dozen different cap values. There’s also adjustment knobs for fine tuning, duty cycle, and DC offset.

Check out the video after the break for a full demonstration. If you want to build this yourself you’ll need to do some chip hunting. The MAX038 is obsolete. You may still be able to find one, but at around $20 you should be able to source a replacement with the same features and save yourself cash all in one step.

Continue reading “Function Generator Built And Mounted Inside Electronics Bench”

AVR DDS Signal Generator Improvements

[Vassilis Papanikolaou] took a good thing and made it better with some design upgrades to this AVR based signal generator. We looked at version 1.0 of this tool back in 2006 and since then it saw an upgrade to 2.0. But [Vassilis] wanted to take things one step further, with a compact single-sided PCB. What you see above is the beautiful result of his work; a professionally made board that is compact, uses through-hole components, and has zero wire jumpers.

If you want to build one for yourself there’s a great parts list as well as board artwork and schematic. The system uses an ATmega16 so you’ll need a way to program one. There’s also just a bit of firmware tweaking to remap the control buttons to match the updated hardware layout.

XR-NOISE Box

[youtube=http://www.youtube.com/watch?v=3l5DOGn_rFw&hl=en&fs=1&]

[denha] has assembled a noise box he calls the XR-NOISE using an XR-2206 multi-waveform function generator. The output has an impressive number of controllable settings, and uses a set of LEDs to indicate sound level and rate. The XR-NOISE uses 1/4″ jacks for both in and out, and can also be controlled by the tap-sensitive mic located on the front of the box. Unfortunately, there doesn’t seem to be any further documentation or schematics to provide context, but it seems that this function generator chip has also been used for other audio hack projects as well, including a scratch-synth using resistive pressure sensors.

[via MatrixSynth]