This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049C: Fixed Duty cycle with deadband

Part Number: TMS320F280049C

Tool/software:

Hi, 

I'm trying to generate 2 inverted PWMs, each pwm has 50% duty cycle and there is a dead band of 200ns between the signals, the Dead band is generated flawlessly

But My problem ,s I can't get precise duty cycle values it varies between 47% - 53% as seen in the oscilloscope pic. below 
So how could i achieve precise duty cycle(exactly 50%) while maintaining the dead band (Code is )

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "f28x_Project.h"
__interrupt void epwm1_ISR(void);
__interrupt void epwm2_ISR(void);
//PWM·Period= (2×Desired·Frequency) / System·Clock
·
Uint16 pwm_period = 333; // 150 kHz frequency with 100 MHz clock
Uint16 duty_cycle_cmpa = 166; // 50% duty cycle (TBPRD/2)
Uint16 deadband_value = 20; // 200 ns deadband (20 clock cycles)
void main(void)
{
// Initialize system
InitSysCtrl();
// Disable interrupts
DINT;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


  • Hi Haystack,

    In order to generate exactly 50% duty on both ePWMA and ePMWB and have dead band it may be easier to generate without using the dead band submodule.

    Dead Band module will apply the rising edge or falling edge delay on the PWM outputs or it can apply both to a single signal. This will shrink or increase your duty of at least one of your PWM signal. 

    Could you instead generate CMPA values that have the calculated dead band in them? Since you're using CMPAU and CMPAD AQ events you can use these for ePWMA. Then invert the AQCTLB settings to generate your complimentary ePWMB signal with CMPBU and CMPBD AQ events.

    Best regards,

    Ryan Ma