Other Parts Discussed in Thread: TMS320F28069, C2000WARE, TMS320F280049
Tool/software: Code Composer Studio
Hi champions,
For background, I am trying to capture signal from eCAP pin, and synchronize the TSCTR pin with syncIn signal from ePwm. So, my setting is something like:
- EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO;
Select source of Synco signal is at CTR = Zero.
2. ECap1Regs.ECCTL2.bit.SYNCI_EN = 1;
Enable sync-in option, thus CAP TSCTR will reset when PWM CTR = Zero.
I have already implemented this setting on TMS320F28069 and It works very well.
Next, I plan to migrate the code to TMS320F280049. There are some differences from the example code in C2000ware, where F280049 uses driverlib. I use the setting on F28069 as reference, and for the sync part I use these two functions:
- EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
HWREGH(base + EPWM_O_TBCTL) =
((HWREGH(base + EPWM_O_TBCTL) & ~(EPWM_TBCTL_SYNCOSEL_M)) | ((uint16_t) EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO << EPWM_TBCTL_SYNCOSEL_S));
Select source of synco is at CTR = Zero.
2. ECAP_enableLoadCounter(ECAP1_BASE);
HWREGH(base + ECAP_O_ECCTL2) |= ECAP_ECCTL2_SYNCI_EN;
Enable sync-in option, thus CAP TSCTR will reset when PWM CTR = Zero.
The problem is when I check the ECap1Regs.TSCTR of F280049, it doesn’t reset at Pwm CTR = 0 and continue to run up to 0xFFFFFFF. I read on manual that CAP of F280049 is type 1 eCAP, but on F28069 is type 0 eCAP. However, I don’t know if there are some differences on synchronization option of the two.
So, what did I miss on the sync setting on F280049, beside these two settings? Is there any difference of type 1 and type 0 eCAP on sync setting?