Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

variable sinewave generator using 12 bit DAC

Status
Not open for further replies.

rampat

Member level 4
Joined
Jun 27, 2007
Messages
69
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,288
Location
bangalore
Activity points
1,756
dac sine wave

Hi,

I want to generate the a varaible sinewave from 10Hz to 50KHz using 8 bit microcontroller and and 12 bit DAC.I have read from the articles that from a look up table you can generate thefixed frewuency sinewave,but if i want to change the frequency i need to change the look up table again,since once microcontroller is programmed,there is least flexibality in changing the data written into its memory.So please suggest me ho to go aboput it ?
 

sine wave generator

Hi,
May be you should use a function generator IC for basic wave generation and use the microcntroller for peripheral control and control of display of frequency and amplitude. Use digitally controlled potentiometers controlled by the micro for up/down control of the frequency and amplitude.

Regards,
Laktronics
 

digitally controlled sine wave generator

No, you do not change the lookup table. You need to change the rate at shich you feed the data to the DAC. The output sinewave results from the data in the DAC. Those are just voltage levels, so they do not change. What changes is the frequency at which they occur.
 
variable sine wave generator

But you should check, if you are able to update the DAC data with the necessary sampling rate and intended timing accuracy. That may get difficult without dedicated hardware or a DMA capable processor.
 

digitally controlled sine-wave generator

First of all, you do not need to change the lookup table (the table where you store the sine wave values) as the output frequency changes. The waveform will be always the same, the only change will be the speed that the points of the table are converted to analog signal. The solution for your problem is the DDS (direct digital synthesis) technique. Study this concept idea. In summary is: you have a table with several phases and their corresponding level (the level of voltage) to fill one cycle or period of your waveform (not necessarily a sinewave, but any waveform you can imagine). There should be an accumulative phase register that increases at a fixed step of phase, this fixed figure will determine the signal frequency of the output. The most significative bits are used to lookup the voltage for the current phase of the register and the register outputs are converted to analog signal (by a D-A converter) and pass through a low pass filter.
There are a lot of specialized DDS chips (as for example AD9833) with very large resolution (0.1Hz).
You could also do this inside a microcontroller or dsp controller. The main points are:
- create a lookup table (for example 256 phases with their correspondent levels)
- assign a phase accumulator register (for example a word variable with 16 bits)
- assign a phase increment register (for example a byte variable with 8 bits)
- a clock of 100kHz to the phase accum register (at least 2x the max output frequency)
- implement a R-2R D-A converter and after a low pass filter (RC network)

The program should: read the phase increment register, add to the accumulator phase register, with an interruption from the 100kHz timebase, take the 8 msb from the phase register, lookup int the waveform table, output it to a port connected to the R2R converter and restart the process. To change the frequency, all you have to do is change the phase increment value. With more bits in the phase accumulator register, you get more resolution.

DO a search in the internet to learn more. A good project can be found at:

http://mondo-technology.com/
 

sine wave generator ic

Good suggestions, generally. My doubts are particularly regarding 12 bit resolution with a PIC or similar and without dedicated hardware. A software based DDS solution usually suffers from some phase jitter (e. g. due to interrupt latencies), but that may be O.K.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top