There's been a lot of discussion around signal generation here:
One poster put up a pointer to this:
Well I thought it looked a fun and useful project, albeit I didn't want to rely on hanging it off a PC for control. So last weekend I made a stand alone version, and even made a nice case!
One Tiny2313 as per original design (with errors in sawtooth waveform
removed) and faster clock and serial connection.
Second Tiny2313 runs a 16x2 LCD (in 4-bit mode for a
change and to keep the 'freak who said I was profligate with pins using an 8-bit interface happy), a rotary quadrature encoder (from a broken stereo)for up/down, four way switch for 'rate' (x1, x2^5, x2^10, x2^15), and a pushbutton for sine, square, sawtooth,triangle.
I found an ancient 2x15V 100mA transformer, so put in some +/-15V
regulators and designed in a current boosted op-amp output. I haven't
fitted the components for this yet, but this will add level and offset pots. Output to two 4mm sockets and BNC.
Results are surprisingly good, with no visible 'bad steps', except the
sawtooth when there was a column of repeated values. I used 1% 1K1 and 2K2
resistors. Runs down to 0.1Hz. Above about 70KHz you start to see obvious
stepping, but the square wave is reasonable up to over 900KHz. It's going
to be fine for basic audio work, or as a low frequency clock source.
I might add an audio output for those times when you want to hear the noise (and for testing bat detectors!).
Changes that could be made? Limiting factor is that any input need to be
interrupt drive and only respond when there is a change, so an A2D and a
pot for adjusting frequency wouldn't work.
Use 1 20MHz AVR and accept the increased glitch when processing changes.
You would need one with additional pin change interrupts (waveform change
button) as well as Int0/1 for the quad decoder.
Using an AVR with 256 byte or more of RAM and copying across the data will
allow an 11% speed increase (8 clocks instead of 9)and allow serial
download of waveform data. More flash could mean more waveforms built in.
Instead of changing the adder value and calculating the resulting
frequency, select a frequency then calculate the adder value. The rate can
then be stepped 0.1,10,1000,100000.
Again, with the waveform in RAM, you could vary the duty cycle in software
although artefacts will be come pronounced at higher frequencies.
Final thought, a 'mini' version using just a tiny 13 or similar with 4/5
bit resolution could make a simple audio tester with up, down and sweep
If there's interest I'll post it up as a project