Implement the following steps to use
SWSYNC with ECAP1 and ECAP3.
- Configure ECAP[1..3].ECCTL2.SYNCO_SEL = 0x0, to allow the
sync-in event to be the sync-out signal pass through.
- Configure ECAP[2..3].ECCTL2.SWSYNC = 0x0, to disable
software synchronization for eCAP2 through eCAP3.
- The default sync signal comes from ePWM1, if
TBCTL[SYNCOSEL] is not correctly configured this can cause undesired resets
of the time-stamp register (TSCTR). Select an unused GPIO in
InputXbarRegs.INPUT5SELECT. Configure this GPIO in output mode and write 0
to the GPIO DAT register. By default, this is programmed to GPIO0 so any
activity on this pin can cause problems with the SWSYNC.
- Program SYNCSEL[ECAP1SYNCIN] = 0x5. This takes
ECAPx.EXTSYNCIN to an inactive state.
- Configure ECAP1.ECCTL2.SWSYNC=0x1, this forces Software
Synchronization of TSCTR counter
To use SWSYNC with other eCAP modules,
make sure that the previous eCAP chain is not generating a SYNCOUT signal that
interferes with the software synchronization.