声明:转自EDA121,版权归EDA121所有
PSoC芯片有专门的可动态配置的PWM模块以及带死区控制的模块,其中有8位和16位两种模块供用户选择。一个8位PWM占用一个数字模块,一个16位PWM占用两个数字模块,一个带死区控制的8位PWM模块需要两个数字模块,一个带死区控制的16位PWM模块需要三个数字模块。所以在配置PWM模块时一定要考虑数字模块的用量。 不带死区控制的PWM跟其它厂商的MCU一样,控制方法也几乎相同,PSoC增加的是死区发生器。死区发生器产生两个输出波形,分别为PHASE1和PHASE2。PHASE1和PHASE2不会同时都为HIGH,一个8位的递减计数器控制死区时间,在死区期间,PHASE1和PHASE2都为LOW。以下是两个输出的动作情况。
Dead Band Generator For each edge of the input signal (PWM8 or PWM16 output), the following is repeated:
Rising Edge ↑ 1、Phase2 signal is reset low on the rising edge of the next clock cycle. 2、DeadTimeCounter register is loaded with the DeadTime register value. 3、DeadTimeCounter register is decremented on each rising edge of the input clock until it reaches the terminal count. Phase1 is then set high on the next falling edge of the clock.
Falling Edge ↓ 1、Phase1 signal is reset low on the rising edge of the following clock cycle. 2、DeadTimeCounter register is loaded with the DeadTime register value. 3、DeadTimeCounter register is decremented on each rising edge of the input clock until it reaches the terminal count. Phase 2 is then set high on the next falling edge of the clock.
Phase1 and Phase2 track the frequency of the input signal received from PWM. Phase1 tracks the duty cycle of the input signal, minus the dead time. Phase2 tracks the inverted cycle of the input signal, minus the dead time.
If you want more,you can download Application Notes about PWMDB.
URL:www.khalus.com.ua/psoc/pdf/modules/PWMDB_27.pdf
|