This circuit is serviceable, but the parts count is high and there is no way to improve on the 1.1 second settling time, and no way to “hold” the analog value without a continuous PWM signal. The gain accuracy is improved by using an external CMOS buffer, powered by a precision reference such that the PWM signal swings between ground and an accurate high level. An output buffer allows the use of a high impedance filter resistor while providing a low impedance analog output. Finally, the PWM signal must be continuous in order to hold the output voltage at a constant value, which may present a problem if the processor is to be put into a low power shutdown state.įigure 2 shows an attempt to remedy these shortcomings. A more subtle effect is that mismatch between the digital output pin’s effective resistance to the supply in the high state, and resistance to ground in the low state must be small compared to the filter resistor’s value in order to maintain linearity. The slope (gain) of the PWM to analog transfer function is determined by the microcontroller’s (probably inaccurate) digital supply voltage. Thus the output must only drive a high impedance load. The impedance of the voltage output is determined by the filter resistor, which can be quite large if the filter capacitor is to be kept to a reasonable size. A 12-bit analog signal should ideally have less than 1LSB of ripple, requiring a 1.2Hz lowpass filter in the case of a 5kHz PWM signal. You don’t have to dig very deep to uncover the myriad deficiencies of this scheme.
0 Comments
Leave a Reply. |