Keywords: Category:
 
Using PWM to Simulate DAC
TIME: 2008-9-21
 
Introduction
 
DAC (Digital to Analog Converter) function is commonly used in electronic and automation application. But there are quite a number of MCUs without DAC output. For this case, we could use PWM output (realized by timer and software) to imitate DAC through simply circuit changing. In this way, we can save much cost, space and improve precision for electronic equipments.
 
Function description
This article introduces a method to simulate 8bit DAC by using AM8EB056. To achieve this, we could change the duty of PWM to get various square waves, and then filter waves by resistance-capacitance filter to get different simulative voltage values.
 
But this method is only available for the cases that don’t require high precision and its load current is small since the voltage on DAC varies with the change of load current and environmental temperature. If users require DAC function with high precision, they need to further improve the circuit by the ways of adding load resistance or load driving in circuit.
 
Design principle
PWM is a type of square wave signal that its high and low level of duty can be adjusted. See its waveform figure as below:
 
As it shows, the levels of PWM are VH and VL. Under ideal conditions, the VL is 0, while in practice the VL is rarely equal to 0, which may cause the error. See the function of PWM waveform as below:
 
 
From the above equation, we can find three parts. The first part indicates direct current component. The second one shows harmonic component (one time), and the third part is the higher order harmonics (more than one time). To meet the needs of DAC, only the first part is required (DC component changes from VL to VL+VH). Hence, we should eliminate the unneeded 2nd and 3rd parts. To achieve this, we can filter these 2 parts by low-pass.
 
... ...
 
ORIGIN: Z.SL
BACK TO TOP PRINT ADD TO FAVORITE SUBMIT CLOSE
 
>>
 OTHERS
 
·Application Note of Recording Modes (EzCode4...
·Using Midi Background
·How to Use General I/O to Drive LCD?
·The Application of One Key One Note
·Making an LED fan by ALPHA MCU
·Using ALPHA IC in Serial Communication
·Application of the Action Function
·Using AM8EB for I2C Communication
 
>>
 RECOMMENDED
 
·About the Recording Duration of AMSR Series ...
·EzCode4E Solutions
·Application Note of Recording Modes (EzCode4...
·Using Midi Background
·The Control of Silicon Controlled Rectifier
·The Application of One Key One Note
·Portamento Effect in AM4F
 
 

About Us Contact Us Disclaimer


ICP Record : 08035793 Prepared Guangdong ICP