R2R Digital to Analouge converter

Status
Not open for further replies.

neptune

Member
Hello mates,

just for fun i made a R2R DAC , it is working fine , but i want to generate beautiful sine wave,
i can not generate it with normal pulse funcion of LTC, what function should i give at input.

NOTE - everything at input is reversed at output because of inverting op-amp operation

Thankyou
 

Attachments

  • DAC.asc
    2.9 KB · Views: 414
Last edited:
but how cant i give random values at input using pulse function ?

Use a 4 bit counter circuit, clock it with a pulse.
On the output pins of the counter have weighted resistors in a OPA summing amp.
 
but counter counts in one direction only.
sine wave needs reverse counting also :?

Look at this, add a filter.

[Extract from previously posted image]
 

Attachments

  • AAesp01.gif
    44.5 KB · Views: 511
  • SineGen1.asc
    5.1 KB · Views: 355
To get a reasonably low distortion sinewave you need many bits (likely 8 or more) of D/A conversion and a look-up table to generate the proper bit pattern that most closely approximates a sinewave.
 
To get a reasonably low distortion sinewave you need many bits (likely 8 or more) of D/A conversion and a look-up table to generate the proper bit pattern that most closely approximates a sinewave.

hi,
If a good quality LPF is used, a very good sine wave can be generated from a simple 6 stage Shift Register.
A 8 or more bits are not required for good sine wave generation.

This LTspice simulation was posted recently bt member 'atferrari'. https://www.electro-tech-online.com/threads/trying-to-improve-an-active-lpf.122554/

I have added a reference sine wave to the plot and superimposed it on the LPF output, IMO thats an excellent match.
 

Attachments

  • AAesp02.gif
    42 KB · Views: 386
I should have added to my post that you need a look-up table and many bits if you want to generate a low-distortion sine-wave over a wide frequency range without a (tracking) filter.

A relatively simple tracking filter can be built for audio frequencies using a LMF100 switched cap filter IC.
 
here i built this , how do we select capacitors value in filters ?
 

Attachments

  • DAC-sine.asc
    6.9 KB · Views: 280
here i built this , how do we select capacitors value in filters ?
hi,
I see that the CD4013 logic level is set for +5V, but you are using +9V on the transistor inverter.??

The +V supply for the OPA's in not going anywhere.????
The +5V V1 voltage source has no NET name attached.?

The weighting values of the Summing chain resistors is all wrong.!

EDIT:
Download this Free Filter designer.
https://www.ti.com/tool/filterpro
 

Attachments

  • AAesp02.gif
    17.8 KB · Views: 311
Last edited:
hello,
I corrected this , but why is weighted resistors are wrong , i learned them from my book !
 

Attachments

  • DAC-sine.asc
    7 KB · Views: 306
hello,
I corrected this , but why is weighted resistors are wrong , i learned them from my book !

Look at this image of the stepped waveform at the input of U1 OPA, its no where like a sinewave.??
Look a the resistor values in the LPF image I posted earlier.

BTW: You still have a 9Volt input on a 5V powered 4013.!!
 

Attachments

  • AAesp03.gif
    16.4 KB · Views: 297
Hi neptune,

You seem to be using an R2R resistor network for your analog level generation. If you intend to use a constant width pulse to clock your counters then you cant use an R2R network. An R2R network will give you a ramp, not a sine wave. If you want a sine wave you have to use a different network where the resistors are chosen to give different output voltages for each logic state.
 
oh ! So how does one choses resistance to generate sine wave ?
 
oh ! So how does one choses resistance to generate sine wave ?

Consider that you are trying to create a Sine wave using 6 steps,,,, each 6 steps Up creates a sine wave section from say +Vpeak to -Vpeak and and the next 6 step down say the -Vpeak upto +Vpeak etc.....................

So the weighting of the resistors is chosen to give a +peak to -peak approximation of a sine wave at the input of the 1st OPA

Look at the LPF link I posted for guidance.. clue,, think Sine wave tables.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…