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.

TMS320F28379D: Synchronization of ePWMS

Part Number: TMS320F28379D

Hi

This is in continuation to my previous post which is locked and I can not reply on the same:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void InitEPwm1Example()
{
// Setup TBCLK
EPwm1Regs.TBPRD = TBPFC; // Set timer period 801 TBCLKs
EPwm1Regs.TBPHS.bit.TBPHS = 0x0000; // Phase is 0
EPwm1Regs.TBCTR = 0x0000; // Clear counter
// Set Compare values
EPwm1Regs.CMPA.bit.CMPA = ref_offset; // Set c00ompare A value
EPwm1Regs.CMPB.bit.CMPB = ref_offset; // Set Compare B value
// Setup counter mode
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE; // required to disable this master and for independent pwm generation
// Setup shadowing
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

https://e2e.ti.com/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/977698/tms320f28379d-generating-required-phase-shift-between-epwms/3623264#3623264

I am operating ePWM1,2,7,8 at 200kHZ and ePWM3,4,5,6 at 300kHz.

1. If I set "EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE; " I am able to achieve correct switching frequencies for all the PWMs. However, I am not able to achieve phase-shift between (ePWM3 and ePWM5) and  (ePWM4 and ePWM6) .

2. If I comment out "EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;"  I am not able to achieve correct switching frequencies for all the PWMs, i.e. this time ePWM1 acts as the master and all the modules follow the same frequency as that of ePWM1. However, with this I am able to achieve phase-shift between (ePWM3 and ePWM5) and  (ePWM4 and ePWM6) .

I have attached the code for ePWM1, ePWM3 and ePWM6 here. The code for ePWM5 is similar to ePWM6, ePWM4 is similar to ePWM3.

Please help me resolve this issue.

Thanks

Sneha thakur