3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Easy Atmel Xmega Sine Wave / Waveform Generator

Easy Atmel Xmega Sine Wave / Waveform Generator
This is how you can use one of the BostonAndroid.com Xmega evaluation boards ($20)  to create a simple adjustable sine waveform generator with 12bit resolution and capable of producing frequencies from 125Hz - 20KHz using the integrated DAC. You can modify the code to produce any arbitrary waveform at up to 1MHz on 2 channels. You need only a PC, an eval board and a suitable Atmel programmer (AVRISP is under $30 new).

There are a LOT of features packed into the Xmega microcontrollers. This instructable is meant to demonstrate some of the really powerful ones like a 12bit DAC, 12bit ADC, DMA controller and open source compiler (avr-gcc).
 
Remove these adsRemove these ads by Signing Up
 

Step 1What you need

What you need
You will need the following to complete this project:

Boston Android Xmega EVAL-01 Development Board ($20) or build your own
Murata PV36W103C01B00 Trimpot 10Kohm, 25turn (or equiv from Mouser)
PC with AVR Studio 4 (free)
AVRISP mkII programmer ($30)

 
« Previous StepDownload PDFView All StepsNext Step »
12 comments
Sep 29, 2011. 1:19 PMkosmo!! says:
Where i can set the nummer of cycles?
Sep 29, 2011. 2:55 AMkosmo!! says:
I've forgotten:

Is it possible to realize the two fixed frequenz without potimeter?
Sep 29, 2011. 2:52 AMkosmo!! says:
would it be possible to modify this so that it could generate two frequencies (20khz and 22khz) ?
For example:

int data[] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1};

for (int i = 0; i< sizeof(data); i++){


if(data[i]==1) "frequency should be 22khz" ;
else " it should be 20 khz;
}


It is possible to add this to the source code and is it possible to adjust the repetitions (loops)?
Sep 23, 2011. 1:27 AMgustep12 says:
Very cool, I like that this instructable is very simple and well-explained. I think I might use this as my first XMega build.
Nov 15, 2009. 4:05 AMprakash.mpv says:
Congrats friend great work....
Oct 31, 2009. 5:37 PMdustin4321 says:
 Can anybody get the ADC working in 12bit? I think this would be amazing when interfaced by a synth ribbon controller or an ondes martinot type deal. Very cool and minimal synth toy. But it would surely need the increase in resolution. 

great instructable!
Oct 30, 2009. 8:50 AMmarc.cryan says:
Congrats on the frist X-mega instructable!
Oct 28, 2009. 11:45 PMBerserk87 says:
 Holy crap a true sine wave!
Oct 29, 2009. 5:59 PMBerserk87 says:
would it be possible to modify this so that it could take 12VDC and output 120VAC @ 60Hz.?
basically turn it into an efficient inverter.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
10
Followers
2
Author:wandererwolf(Boston Android)
I grew up in upstate NY where I speant many hours with my brothers playing with legos (I once attempted to test relativity by connecting a large number of gears to a small lego motor.. results inconcl...
more »