Digital Sine Wave Generation

davyna

Joined May 15, 2013
13
Last edited by a moderator:

Wendy

Joined Mar 24, 2008
22,703
Congratulations,

Welcome to AAC.

Congratulations, you have practiced the arcane art of necromancy, the revival of a long dead thread. Likely the OP (Original Poster) has solved his problem in the years that has passed, or thrown it away, or something.

In adddition, a thread belongs to the OP (original poster). Trying to take over someone elses thread is called hijacking, which is not allowed at All About Circuits. I have therefore given you a thread of your very own.

This was split from need help understanding how digital sine wave circuit works

davyna

Joined May 15, 2013
13
How a timer and counter can generate sine-wave? help me..

crutschow

Joined Mar 14, 2008
28,541
The circuit is a crude Digital-Analog converter. As the switches are sequentially sequenced ON and OFF the output voltage will rise and fall in a stepped sine-wave with value determined by the voltage divider resistors connected to the ON output.

ScottWang

Joined Aug 23, 2012
7,119
NE555 → 8 bits Counter(CD4520) → 4bits sinewave DAC (16 digits)
The resistors as 10K,20K,40K,80K,80K,40K,20K,10K

NE555 → 16 bits Counter(CD4520) → 8bits sinewave DAC (256 digits)
The resistors as 1K,2K,4K,8K,10K,20K,40K,80K,80K,40K,20K,10K,8K,4K,2K,1k

8bits sinewave DAC (http://www.lennard.net.nz/electronics/dac.html#r2r)

Ron H

Joined Apr 14, 2005
7,014
NE555 → 8 bits Counter(CD4520) → 4bits sinewave DAC (16 digits)
The resistors as 10K,20K,40K,80K,80K,40K,20K,10K

NE555 → 16 bits Counter(CD4520) → 8bits sinewave DAC (256 digits)
The resistors as 1K,2K,4K,8K,10K,20K,40K,80K,80K,40K,20K,10K,8K,4K,2K,1k

8bits sinewave DAC (http://www.lennard.net.nz/electronics/dac.html#r2r)
Scott, can you post a schematic of the
4bits sinewave DAC (16 digits)
The resistors as 10K,20K,40K,80K,80K,40K,20K,10K
?
I can't see how it works.

ScottWang

Joined Aug 23, 2012
7,119
Scott, can you post a schematic of the
4bits sinewave DAC (16 digits)
The resistors as 10K,20K,40K,80K,80K,40K,20K,10K
?
I can't see how it works.
Ron H, the method almost there, the linked page is only 4 bits(16 digits), the waveform will be only low to high, so it needs to adding the waveform from high to low, that's why I want to using 8 resistors.

if you felt that the circuit seems can't get a good sine wave, that's true, because the OP asked for a timer and counter can generate sine-wave, that's not a good way to generate a sine wave.

I have been designed a digital sine wave for a industrial product used, I can't post the details, but I can sharing the idea, there are somethings need to modify, when using a math to calculate and drawing the sine wave and to get the values of the waveform, and the frequency is fixed.

1. To get or write a program to drawing a waveform of sine wave and to get the 256 bytes data of the waveform, the data should be according to the input frequency.

2. When I get the data, I still need to modify the data, this is a boring and hard work, because I have to check each byte from 256 bytes, when the position of data is not right, then I have to change it, so I have to modify again and again.

3. The 256 bytes data of sine wave saved into the 8 data bits EEPROM.

Square wave → 8 bits Binary counter → sine wave EEPROM → 8bits DAC → Op Amp Waveform shaping → sine wave

The input frequency divided by 256, so the output frequency are equal to input frequency /256.

I'm not sure all the described is correct or not.

Last edited:

Ron H

Joined Apr 14, 2005
7,014
Scott, I requested a schematic, but all I got was a lot of hand-waving.
Do the circuits you described in post #5 work, or not?

Last edited:

THE_RB

Joined Feb 11, 2008
5,438
Does it have to be using a 555 and a counter? What did you need to make sinewaves for?

I did a project for a 1kHz "precision" sine generator, using a PIC to digitally make the sine wave using PWM;

http://romanblack.com/onesec/Sine1kHz.htm

Generally this is a much simpler circuit and will produce much better frequency accuracy and much better sine shape accuracy;

ErnieM

Joined Apr 24, 2011
8,217
Square wave → 8 bits Binary counter → sine wave EEPROM → 8bits DAC → Op Amp Waveform shaping → sine wave
If you replace the EEPROM with RAM and make the clock adjustable you have the innards of an arbitrary waveform generator.

davyna

Joined May 15, 2013
13
hi, how can i obtain pure sine wave fro this wave
o get
I want to get the pure sine wave help me

kubeek

Joined Sep 20, 2005
5,770
since it is digitally generated it will never be a pure sine. You could try lowpass filtering it to reduce the harmonics. Or use more levels to get better approximation.