1.8.14.16 1.27.13.16 1.28.16.16 1.34.11.16 1.41.13.16 1.42.11.16 PWMx_ChannelDeadTimeSet Function
C
/* x = PWM instance number */ void PWMx_ChannelDeadTimeSet (PWM_CHANNEL_NUM channel, uint16_t deadtime_high, uint16_t deadtime_low)
Summary
Writes dead time values of given PWM channel.
Description
This function writes the dead time value in double buffer register. Update to the actual dead time register happens at the next period border. For left-aligned mode, update occurs when counter value = period value For center-aligned mode, update occurs when counter value = 0 while decrementing
Precondition
PWMx_Initialize() function must have been called first for associated channel. And associated PWM channel must be running.
Parameters
Param | Description |
---|---|
channel | PWM channel number |
deadtime_high | dead time inserted on high side output waveform |
deadtime_low | dead time inserted on low side output waveform |
Returns
None
Example
PWM0_Initialize(); PWM0_ChannelsStart(PWM_CHANNEL_0_MASK); PWM0_ChannelDeadTimeSet(PWM_CHANNEL_0, 0x250, 0x50);
Remarks
Dead time is inserted between the edges of the two complementary outputs DTOHx and DTOLx to safely drive the external power control switches. In sync mode, unlock bit (PWM_SCUC.UPDULOCK) should be set explicitly to trigger the update of dead time value at the next PWM period border. Use API PWMx_SyncUpdateEnable to set the PWM_SCUC.UPDULOCK bit.