EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: Moriambar on August 25, 2018, 08:43:11 am
-
Hi,
I am a newbie here and in the EE world (kinda). Looking at our beloved Dave videos, I came about to appreciate PWM as a DAC alternative. Anyway picking up a PIC16F15325 (http://ww1.microchip.com/downloads/en/DeviceDoc/40001865B.pdf), I found out that it has a 5bit DAC function, as well as several 10 bit PWMs.
So my thought is: if I can be able to be way more precise with a simulated DAC via pwm, why include a DAC functionality from the start? So I thought that perhaps I misunderstand something and 10bit PWM is not better than 5bit DAC.
Well I tried searching the info online but I'm lost :-//. Can anyone point me in the right direction, please?
-
Using PWM as a DAC is usually slow and often needs an extra filter (e.g. 3rd order active filter with 1 OP). The real DAC inside the µC is likely much faster and lower power. There are still quite some application that can get away with using PWM and thus a DAC is not such a common part in µCs.
-
Thanks! So basically either you go for "built-in, quick, low power, but with less steps" or you can go for "slow, precise, not so low powe, but needing extra filtering steps", right?
Cheers
-
Thanks! So basically either you go for "built-in, quick, low power, but with less steps" or you can go for "slow, precise, not so low powe, but needing extra filtering steps", right?
Cheers
In this case yes. Other micros have higher resolution DACs built in, 12 bits is now reasonably common.
-
Another thing with the DAC is that you can change the reference voltage or use an external one at an arbitary voltage, So in the end you end up with more than 5 bits worth of steps with some clever programming
-
Keep in mind that to clock out 10-bits over PWM takes 1024 periods, even with 16 MHz PWM, max update rate less that 16 kHz.
-
Another thing with the DAC is that you can change the reference voltage or use an external one at an arbitary voltage, So in the end you end up with more than 5 bits worth of steps with some clever programming
I did not think about that, you're right! Thanks!
Keep in mind that to clock out 10-bits over PWM takes 1024 periods, even with 16 MHz PWM, max update rate less that 16 kHz.
Right, of course!
-
Keep in mind that to clock out 10-bits over PWM takes 1024 periods, even with 16 MHz PWM, max update rate less that 16 kHz.
Thats true only if no noise shaping is used.Snake oil music format DSD uses 1 bit PDM 64 periods to get 20 bit resolution with 7th order noise shaping and dither.