Hi i testing the differents channels modes PDCM for eTPU2 with MPC5746R and i dont understand the functionality of the bit T1ET2. The IDE for eTPU is CodeWarrior Development Studio for eTPU v10.3. I think that T1ET2 enables the Capture2 when it detect a Capture1 initialiy blocked.
I configured PDCM = SM_ST and set an input signal of pulses and the channel programmed in the IDE eTPU:
if(hsr == CAM_HSR_INIT)
{
match_disable();
channel.MTD = MTD_DISABLE;
channel.MRLE = 0;
channel.TDL = TDL_CLEAR;
channel.LSR = LSR_CLEAR;
channel.MRLA = MRL_CLEAR;
channel.MRLB = MRL_CLEAR;
channel.PDCM = PDCM_SM_ST;
channel.TBSA = TBS_M1C2GE;
channel.TBSB = TBS_M1C1GE;
channel.IPACA = IPAC_FALLING;
channel.IPACB = IPAC_RISING;
channel.OPACA = OPAC_NO_CHANGE;
channel.OPACB = OPAC_NO_CHANGE;
channel.MTD = MTD_ENABLE;
}
else if(TransA == 1) //Falling edge
{
channel.TDLA = TDL_CLEAR;
channel.CIRC = CIRC_INT_FROM_SERVICED; //Interrupt to the HOST
}
else if(TransB == 1) //Rising edge
{
channel.TDLB = TDL_CLEAR;
channel.CIRC = CIRC_INT_FROM_SERVICED; //Interrupt to the HOST
}
In my interrupt of MPC5746R, i conmute a pin for any write of channel.CIRC. The result is that only detects the Thread of (TransA == 1), Why? The input capture B should not be activated when it detects the falling edge?. If i set PDCM = SM_ST customizable with UDCM but with the bit T1ET2 = OFF, it works as expected.
In SM_ST mode it is correct that TDLB (action unit B transition detect) is enabled once TDLA is set, however, the code you show clears TDLA upon service of the falling edge detect - under most circumstances this would mean the window for TDLB to get set is very small.
When latency (due to another active eTPU channel) is introduced, the window can be made large enough for TDLB to activate. In the image below, the green line represents set TDLA, and blue line is set TDLB.
As you found, by setting T1ET2 off via UDCM, an inactive TDLA no longer blocks TDLB - transition detection on the two units is independent.
See additional resources for learning about the eTPU:
https://www.ashware.com/etpu-training
https://www.ashware.com/etpu-programming-made-easy-book
https://www.ashware.com/consulting