Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Xmega32 E5 DDS Sine Wave Signal Generator Example

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 627
Location: Cleveland, OH

usa.gif
PostPosted: Tue Feb 14, 2017 10:04 pm    Post subject: Xmega32 E5 DDS Sine Wave Signal Generator Example Reply with quote

The following is a simple DDS Sine Wave Generator for the Xmega E5 series.

It is not a Direct Digital Synthesis tutorial, but if you are familiar with the concept it should make sense.
Basically one has a signal lookup table, (Sine, Square, Triangle, etc.), and runs an ISR at a fixed, fast, rate.
One calculates the next sample to output based upon the desired output frequency, table size, and DAC update rate.

This program is set up for a 62.5 kHz DDS ISR, (sample update rate).
The number of samples the output signal has is fixed at 62.5 k samples / Second.

A 1 Hz sine wave would have 62.5 K samples for one Period of the sine wave.
A 1 KHz sine wave would have 62.5 samples per one Period of the sine wave.
A 10 KHz sine wave would have 6.25 samples per one Period of the sine wave.

Know that even a simple first or second order Low Pass Filter will significantly clean up the output signal by removing the higher frequency components of the "stair-step" signal.

There is certainly room for improvement, but this demonstrates a working example of the concept.

JC
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6197
Location: Holland

blank.gif
PostPosted: Tue Feb 14, 2017 10:12 pm    Post subject: Reply with quote

thanks for sharing Very Happy
_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum