cailuqijia 发表于 2008-3-24 16:59:16

如何用AVR单片机实现PWM输出带死区控制?

如何用AVR单片机实现PWM输出带死区控制?我们都知道.AVR很容易实现PWM输出.包括快速PWM,相位修正PWM,调频调相PWM等等.为我们选择何种控制提供了丰富的资源.但是我有一个疑问是.很多情况是用AVR单片机控制逆变等需要两路以上的PWM输出.为防止开关元件直通.必须在两路PWM输出中加入死区时间.AVR不象是DSP2812,2407等有专门的可产生带死区的PWM输出.AVR单片机技术规格书中说."在对T/C寄存器TCNTx的写操作将在下一个时钟阻止比较匹配.如果非要在TCNTx计数到0XFF.T/Cx溢出中断中修改TCNTx,将有可能丢失一次TCNTx和OCR0x的比较匹配".那在什么时机可以修改TCNTx而不会丢失一次TCNTx和OCR0x的比较匹配?还有如何产生带死区的PWM输出,请马老师讲讲.大家都用什么方法输出带死区的PWM输出?

machao 发表于 2008-3-24 20:35:14

AVR有可产生带死区的PWM输出的芯片,你可以到ATMEL站上查一下.

machao 发表于 2008-3-25 01:05:25

ATtiny261/461/861

16.5 Dead Time Generator

The Dead Time Generator is provided for the Timer/Counter1 PWM output pairs to allow driving external power control switches safely. The Dead Time Generator is a separate block that can be used to insert dead times (non-overlapping times) for the Timer/Counter1 complementary output pairs OC1x and OC1x when the PWM mode is enabled and the COM1x1:0 bits are set to “01”. The sharing of tasks is as follows: the Waveform Generator generates the Waveform Output OCW1x) and the Dead Time Generator generates the non-overlapping PWM output pair from the Waveform Output. Three Dead Time Generators are provided, one for each PWM output. The non-overlap time is adjustable and the PWM output and it’s complementary output are adjusted separately, and independently for both PWM outputs.
页: [1]
查看完整版本: 如何用AVR单片机实现PWM输出带死区控制?