shangdawei 发表于 2005-3-28 22:35:51

如何利用AVR的PWM和ADC实现0/3.3/5/9/12V 的电压输出?

想制做一个编程器,有一个控制脚作为编程电压Vpp, 通过AVR的PWM和ADC控制它的电压输出,可以输出0/3.3/5/9/12V ,请教如何才可以实现?

shangdawei 发表于 2005-3-29 00:16:37

先贴一个



http://cache.amobbs.com/bbs_upload782111/files_1/armok0142869.gif

shangdawei 发表于 2005-3-29 00:17:43

全是E文, 看不懂



http://horizon.bc.ca/~mbaril/Pyxis/supply.html

http://horizon.bc.ca/~mbaril/Pyxis/

shangdawei 发表于 2005-3-29 00:18:42

这个是电路图

http://horizon.bc.ca/~mbaril/Pyxis/Docs/supply_schem.pdf

uwinchen 发表于 2005-3-29 09:34:29

不如直接接一个0832,搞直通模式,你需要牺牲8个i/o口输出就行了,什么都不用管,没必要跟着教科书那样接N个选通脚。



如果接多个d/a,或者工业应用除外噢

ilan2003 发表于 2005-3-29 10:59:58

还要看电流输出的,万一电流输出大,DAC不管用的

shangdawei 发表于 2015-9-2 14:38:48










Digital Adjustment of DC-DC Converter OutputVoltage in Portable Applications






shangdawei 发表于 2015-9-2 14:43:21





DAC = 0V : Vo = 1.233 * ( 2200 / 390 ) + 1.233 * ( 1 + 2200/180 ) = 6.95V + 16.303V = 23.253VDAC = 1.233V : V0 = 1.233 * ( 1 + 2200/180 ) = 16.303V TPS61045 Digitally Adjustable Boost Converter (Rev. C)




shangdawei 发表于 2015-9-2 14:47:10

Simple Addition Permits Voltage Control Of DC-DC Converter's Output
1. The output voltage in a conventional dc-dc buck converter is fixed and depends on the resistor divider, R1/R2.The added circuitry in Figure 2 enables users to control the same dc-dc converter’s output voltage using VC.

2. The added circuitry in this version of the dc-dc converter permits control of VOut by varying a control voltage, VC.
In this case, R2 is not connected to the ground but, rather, to Vr. Equation 1 then becomes:VOUT = VFB + ( ( VFB - VR ) / R2 ) * R1VOUT - VR = VFB - VR + ( ( VFB - VR ) / R2 ) * R1 VOUT - VR = ( VFB - VR ) * R2 / R2+ ( VFB - VR ) * R1 / R2 VOUT - VR = ( VFB - VR ) * ( R2 +R1 ) / R2 Since R1 = 20 kΩ and R2 = 10 kΩ, Equation 2 can be simplified to:VOut – Vr = 3(Vfb – Vr)(3)or:VOut = 3 Vfb – 2 Vr(4)
( VC - V- ) / R4 = ( V- - VR ) / R3 ( I4 = I3 )VC / R4 - V- / R4 = V- / R3 - VR / R3V- / R4 + V- / R3 = VC / R4 + VR / R3V- * ( R3 + R4 ) / ( R3 * R4 ) = ( VC * R3 + VR * R4 )/ ( R3 * R4 )V- * ( R3 + R4 )= ( VC * R3 + VR * R4 )VR * R4 =V- * ( R3 + R4 ) - VC * R3V- = V+ = VREF : VR * R4 =VREF * ( R3 + R4 ) - VC * R3R3 = R4 : VR * R3 =VREF * ( R3 + R3 ) - VC * R3VR = VREF * 2 - VC
R3 and R4 have the same value, 10 kΩ, so amplifier U2’s output voltage is:Vr = 2 VRef – VC(5)where VRef is the reference voltage generated by U3 after resistor divider R7/R8.VOut = 3 Vfb – 2 Vr(4)Combining Equation 4 and Equation 5:VOut = 3 Vfb – 4 VRef + 2 VC (6)To simplify Equation 6, choose components that make:3 Vfb = 4 VRef(7)Then Equation 6 becomes:VOut = 2 VC (8)       The internal voltage reference of U1 is 0.8 V. ( TPS54332 )VREF = 3VFB / 4 = 3 *0.8 / 4 = 0.6V LM4040D25 : 2.5V : By choosing R7 = 10 kΩ and R8 = 3.16 kΩ, VRef = 0.6 V, satisfying Equation 7.Finally, C1 lowers U2’s output impedance at high frequencies,
maintaining the stability of U1’s feedback loop.The added circuitry allows users to control the buck converter’s output voltage,VOut, in the range of 0 to 5 V with a control voltage, VC, in the range of 0 to 2.5 V.Similar circuitry can be designed for use with a boost converter,or any other dc-dc converter, as long as its feedback voltage pin is accessible.

HYLG 发表于 2015-9-2 14:52:26


这是论坛经典的LM2576的数控电源。
传点我做的笔记。
PWM模式WGM13-10=14
PWM最大值ICR1=3700对应PWM输出5V
0对应输出电压0.00,324-1脚电压-1.25,324-5脚电压0.56
100对应输出电压1.00V,324-1脚电压-1,324-5脚电压0.72
200对应输出电压2.00V,324-1脚电压-0.72,324-5脚电压0.86
500对应输出电压5.00,324-1脚电压0.55,324-5脚电压1.20
800对应输出电压8.00,324-1脚电压0.8,324-5脚电压1.57
1000对应输出电压10.00,324-1脚电压1.31,324-5脚电压1.81
1500对应输出电压15.00,324-1脚电压2.59,324-5脚电压2.4
2000对应输出电压20.00,324-1脚电压3.9,324-5脚电压3.15
2500对应输出电压25.00,324-1脚电压5.21,324-5脚电压
3000对应输出电压30.00,324-1脚电压6.5,324-5脚电压

HYLG 发表于 2015-9-2 14:54:27

单片机用的是MEGA48。

shangdawei 发表于 2015-9-2 14:55:04

HYLG 发表于 2015-9-2 14:52
这是论坛经典的LM2576的数控电源。
传点我做的笔记。
PWM模式WGM13-10=14


谢谢你的分享!

motone 发表于 2015-9-2 15:06:23

这种方法很多,最简单的可以用开关量控制。
页: [1]
查看完整版本: 如何利用AVR的PWM和ADC实现0/3.3/5/9/12V 的电压输出?