DAC will mostly be used to convert a byte or integer into an analogue signal. The analogue signal can mostly be any value between the power supply voltages 0 and 5 Volt. However, instead of the 5V also an external Vref can be chosen. So far it sounds familiar.
But you know, Vref can be a signal between 0-5Volt, not only dc but any signal. Most DACs are just a number of resistances in series, see scheme. By changing the byte of the DAC Vref will be connected to one (or more) of the resistances with result that the Vref will just be attenuated at the output.
I started with a sinus signal top-top between 0-5 Volt. In the two scope pictures you see both input (larger sinus) and output of the DAC (smaller sinus). Youtube movie shows the output as with variating of the byte value of the DAC (5 bits for 16F1847).
https://www.youtube.com/watch?v=1XD8VF9WPvQ
Jan Lichtenbelt
DAC as digital attenuator
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
- Contact:
Re: DAC as digital attenuator
Very clever Jan.... Thanks for sharing
Best
Pete
Best
Pete
sorry about that Chief!
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: DAC as digital attenuator
I hadn't thought about using a varying signal into VRef+, great idea.
I guess you could use a similar approach for something like volume control. The DAC outputs the signal and you can use a pot to control the voltage to VRef which scales the output.
Very cool, thanks for sharing.
I guess you could use a similar approach for something like volume control. The DAC outputs the signal and you can use a pot to control the voltage to VRef which scales the output.
Very cool, thanks for sharing.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel