DDS Signal Generator

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's been a lot of discussion around signal generation here:

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=110414&postdays=0&postorder=asc

One poster put up a pointer to this:

http://www.myplace.nu/avr/minidds/index.htm

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
settings.

If there's interest I'll post it up as a project

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A little OT, but upon coming across this DDS hardware module for just $18 I couldn't resist. Sine and square wave outputs avalible. Wish me luck on interfacing it with an Arduino board.

http://iteadstudio.com/store/ind...

Lefty

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd like to see it posted as a project ! :D

joeyAVR wrote:

If there's interest I'll post it up as a project

Gary - W4GNS
Tel: BR549

In my many years I have come to a conclusion that one useless man is a shame, two is a law firm and three or more is a congress. -- John Adams