EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: Circlotron on December 03, 2021, 08:42:35 am

Title: PWM-ing the LSB of a DAC
Post by: Circlotron on December 03, 2021, 08:42:35 am
Say we have an 8-bit DAC that we want to squeeze a bit more resolution out of. We could PWM the LSB at one of 16 different pulse widths, and provided we do it rapidly enough and then low pass filter it we have greater analog resolution. What would it be though? 12 bits or only 11?
Title: Re: PWM-ing the LSB of a DAC
Post by: fcb on December 03, 2021, 09:18:52 am
Can't see why it wouldn't work. Probably DAC dependent to some extent.

As for theoretical resolution, look at it as a 7bit DAC plus a 4bit DAC = 11 bits.

Upsides:
Settling time for large transistions reduced considerably due to hybrid nature.
Much faster than a pure PWM DAC.
Uses an 8bit DAC which *might* be cheaper/more available than a 12bit DAC.

Downsides:
Slows down throughput by at least 16x (11bit) to 32x (12bit)
Device dependent - might be some anomalies in the rise/fall times of the DAC leading to non-linearaties.
Filtering will be more complex, probably get best performance with a 3rd+ order filter - (opamps may be cheap and you might already be filtering elsewhere so perhaps not a downside).
Title: Re: PWM-ing the LSB of a DAC
Post by: artag on December 03, 2021, 10:00:47 am
You can do it. It's called dithering.
Title: Re: PWM-ing the LSB of a DAC
Post by: tszaboo on December 03, 2021, 10:08:09 am
Depending on the DNL and INL of the DAC, you might get better accuracy and resolution, or worse accuracy and better resolution.
Title: Re: PWM-ing the LSB of a DAC
Post by: Psi on December 03, 2021, 10:19:55 am
It gets even more complex when you have 3 DACs and you use two to dynamically set the Vref min and max of the 3rd.  ;)
Title: Re: PWM-ing the LSB of a DAC
Post by: Circlotron on December 03, 2021, 11:35:53 am
As for theoretical resolution, look at it as a 7bit DAC plus a 4bit DAC = 11 bits.
:-+
Title: Re: PWM-ing the LSB of a DAC
Post by: langwadt on December 03, 2021, 11:53:35 am
Say we have an 8-bit DAC that we want to squeeze a bit more resolution out of. We could PWM the LSB at one of 16 different pulse widths, and provided we do it rapidly enough and then low pass filter it we have greater analog resolution. What would it be though? 12 bits or only 11?

you can also use deltasigma modulation, taken to the extreme with a single bit DAC
Title: Re: PWM-ing the LSB of a DAC
Post by: Berni on December 03, 2021, 12:11:33 pm
Yep this is how delta sigma works.

Most audio DACs you listen to only have around 1 to 6 bits of resolution, but they run them at >10MSPS and use modulation to get those 24bits out of them at audio frequencies. The faster your DAC is the more leftover samplerate you have to turn into extra bits. Tho there are practical limits to all of this, the DACs used for audio are particularly designed for being well suited for delta sigma.
Title: Re: PWM-ing the LSB of a DAC
Post by: peter-h on December 03, 2021, 05:35:53 pm
Yes this is done with ADCs too - you inject noise into the input voltage and then take say 100 readings, add them up, and divide by 100, for a 10x resolution improvement.

The problem is that you just get more resolution, not usually more accuracy, and the ADCs and DACs which are on-chip in most micros are crippled by noise, so the last 1-2 bits are just fiction.
Title: Re: PWM-ing the LSB of a DAC
Post by: fourfathom on December 03, 2021, 05:50:08 pm
the ADCs and DACs which are on-chip in most micros are crippled by noise, so the last 1-2 bits are just fiction.

No, they are free dithering!  (or not, of course, depending on the noise.)