Can you use an AVR to make a waveform generator?

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

Hi,

I've seen where you can use the A/D converted to convert an analog pin value to digital. Can you do the reverse? Output an analog value on a pin based on a digital value??

Thanks,

Alan

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

Yes.

There is a built-in Digital to Analog converter module in the XMega series of AVRs.

You can also use a dedicated DAC chip.

You can also use a plain old port to output 1's and 0's to an R2R Ladder, which converts the digital value to an analog voltage.

You can also output a pulse stream, with a variable duty cycle, fed to an RC low pass filter, which will give you an analog output voltage.

Lots of options exist!

JC

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

Check this out:(Direct digital synthesis)

[url]
http://en.wikipedia.org/wiki/Dir...
[/url]

I remember in one of the posts there was a link to a DDS implementation using AVR. Will post it if I find it.

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

Jespers Mini-DDS using a mega and an R/2R ladder, not an xmega:

http://www.myplace.nu/avr/minidd...

Stealing Proteus doesn't make you an engineer.

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

Here's my version of Jesper's Mini-DDS using a DAC chip:

http://www.geocities.com/leon_heller/minidds

I've converted his code for the Atmel assembler.

Leon

Leon Heller G1HSM

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

AVR335 is worth a squint too.

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

I implemented an arbitrary waveform generator on my XMEGA project:
http://www.gabotronics.com/devel...

You can see a video here:
http://www.gabotronics.com/produ...

It uses the XMEGA's internal DAC and the DMA. Once the waveform is setup, it requires no CPU intervention.