PWM And DAC

Status
Not open for further replies.
Hi, I've a 16bit output digital word and wanna output analog voltage from it , what are the requirments , i've AVR atmega16,32 available to me
 
You could use a PWM-based digital-to-analog converter (D2A or DAC). You change the PWM duty-cycle which changes the DC-bias of the PWM waveform. YOu then use an RC filter (or some other filter) to filter out the high frequencies leaving you with the DC-bias of the PWM signal which is your analog output voltage. If you choose this method, you need a MCU that has PWM that has 16-bit resolution.

For example, for a 0-5V square wave:
0% duty cycle would produce 0V
25% duty cycle would produce 1.25V
100% duty cycle would produce 5V

You could also just use a pre-made D2A/DAC IC and control it with your MCU. In this case you would need SPI or I2C, or whatever serial protocal the DAC IC uses.
 
Last edited:
The R & C filter values are determined by the PWM frequency and the frequency or rate-of-change of the digital words (modulating frequency). The filter is used to suppress the noise ripple from the PWM pulses. Ideally, for 16-bits, you want the PWM frequency ripple to be suppressed to less than 1 LSB or 1/65536 (-96dB) below the maximum output at the highest frequency of the modulating frequency.

If you can tolerate a noise level higher than 1 LSB than less filtering would be required. You have to decide how much PWM noise you can tolerate in your application. If the modulating and PWM frequencies are not far apart then you may need to go to more complex filters (multiple-pole active filters) to get the desired suppression of the PWM ripple. (TI has a free program at Active Filter Design Application - FILTERPRO - TI Software Folder that helps in the design of active filters for various frequencies and poles.)
 
A dedicated DAC is easier to filter since there's no high frequency carrier, especially if you want 16-bit accuracy.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…