Other Parts Discussed in Thread: TMS320F28377D, TMS320F280049
Hello, I have a problem that probably is more difficult to describe than to solve.
I've ported the TIDM-02002 code to TMS320F28377D, as described in the previous referenced threads. Everything works as expected, except for the synchronous rectification.
Just to quickly summarize what the code does, the LLC tank current is fed to a comparator (CMPSS2) and then the comparator outputs are connected as follows:
* CTRIP2 goes to the Digital Compare submodule of EPWM3, which in turn goes to the Trip Zone submodule of EPWM3, which drives the PWM signals depending on the current. Basically it is used to "simulate" an ideal diode and to shut down the MOSFETs when the current changes direction.
* CTRIP2OUT goes to an output XBAR and then to a GPIO used as a debug/monitoring signal
Both signals are connected to the same source, COMPCTL.CTRIPSEL=COMPCTL.CTRIPOUTSEL=0. Normally they are set to 3 (the comparator trip signal is latched and it is reset by the PWM module at a certain point); for this test I have set it to 0 (asynchronous) for more clarity. However the problem is present with every mux setting.
The problem is that the trip output signal has a huge delay (about 2 microseconds) from the moment that the input current signal crosses the comparator threshold:

(Ignore the labels and the channel ranges)
The pink trace is the simulated current signal (the comparator trips when the signals goes low)
The light blue trace is the diagnostic signal connected to CTRIP2OUT
The blue trace is the EPWM3 output A (it shuts down immediately when the CTRIP2 trips, as expected)
From the falling edge of the pink trace and the rising edge of the light blue trace, there should be just the comparator propagation delay (that according to the datasheet it is 21 ns). Instead, there is a whole 2 microsecond delay. If I further reduce the duty cycle (below 2 microseconds), the CTRIP2OUT signal disappears completely. It is like there is some sort of "debouncer" that filters out impulses shorter than 2 microseconds.
It cannot be the digital filter of the CMPSS: the problem is also present on the asynchronous path (COMPCTL.CTRIPHSEL=0) which bypasses the filter, and anyway the filter is disabled (CTRIPHFILCTL and CTRIPHFILCLKCTL are both set to 0).
Since the original code running on TMS320F280049 evidently did not have this problem, I suppose that this is due to differences between the two MCUs, but at the moment I have no clue.
Any ideas? Thank you!
L.

