1 Introduction Many embedded microcontroller applications require generation of analog signals. Sometimes an integrated or stand-alone digital-to-analog converter(DAC) is used for this purpose.
However, PWM signals can often be used for generating the required analog signals. PWM signals can be used to create both dc and ac analog signals. The report below discusses using a PWM timer as a DAC and shows an example of simultaneously creating a sinusoid,a ramp, and a dc level and adding the dc level and sine wave to produce an offset ac signal. This report uses the PWM timer Timer_B. Timer_A could also be used in a similar manner.
2 Theory of Operation A PWM signal is a digital signal with fixed frequency but varying duty cycle. An example of a PWM signal is shown in Figure 1. If the duty cycle of the PWM signal is varied with time, and the PWM signal is filtered, the output of the filter will be an analog signal.
文件名 | 大小 |
使用PWM实现DAC.pdf | 1M |
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !