Hello all,
I'm working on a scheme in which I want epwm1 to be synchronized to an external pulse via EXTSYNCIN1. The source of EXTSYNCIN1 is actually frequency-locked to SYSCLK, and I know what it's period will be, so I just need a single SYNC event in order to align the timebase of epwm1. From then on things will stay locked via dead-reckoning.
My plan was to set up epwm1 such that it is free running, but EXTSYNCIN1 is initially tied to an unbonded GPIO (via INPUTXBAR5) to prevent SYNCI from occurring. Then when I want to synchronize, I do the following
// clear SYNCI, in case it was set EPwm1Regs.TBSTS.bit.SYNCI=1; // connect EXTSYNCIN1 to the correct GPIO XBAR_setInputPin(XBAR_INPUT5, GPIO_Sync); // wait until SYNCI is detected while(EPwm1Regs.TBSTS.bit.SYNCI==0); // connect EXTSYNCIN1 to unbonded GPIO again, preventing further SYNCI events XBAR_setInputPin(XBAR_INPUT5, GPIO_DUMMYXBAR);
But while reading the TRM I noticed the OSHTSYNC and OSHTSYNCMODE bits in TBCTL2. The TBCTL2 table seems to be the only place these bits are mentioned, but they sound like a better way to implement what I want (no need for a loop polling TBSTS.SYNCI).
I could only find a couple other questions on E2E regarding these bits. This thread suggested that "The oneshot sync put is going to send out immediately. IF it is enabled." which isn't what I want. But this doesn't really make sense to me either... how is that different from SWFSYNC in TBCTL?
This other thread seems to suggest that OSHTSYNC does what I want it to. But this thread is regarding the F28002x devices. The TRM for the F28002x has much more description of this function, and there are many other differences, including entire registers that aren't mentioned in the F2837x TRM. Table 3-30 in The C2000 Real-Time Control MCU Peripherals reference guide states that both these devices have type 4 ePWMs, but also states there are some differences between them....
Any help would be appreciated.
Regards,
Mike









