Hello,
I imported one of the sample project Example_2806xEPwmDCEventTripComp and edited to have ePWM1A to stay high when the comparator1A=ADCINA2 terminal is lower than 1.6V. "cycle-by-cycle".
I got an expected waveform but please let me ask a remaining question.
To set the ePWM1A state under trip, I needed to write {EPwm1Regs.TZCTL.bit.DCAEVT1}.
Why this is not DCAEVT2 but DCAEVT1 ? I thought the DCAEVT1 is just for one-shot.
Please open the zipped CCS740 project. The project has a result waveform and wiring information for test.
EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT; // DCAH = Comparator 1 output
EPwm1Regs.DCTRIPSEL.bit.DCALCOMPSEL = DC_TZ2; // DCAL = TZ2
EPwm1Regs.TZDCSEL.bit.DCAEVT1 = TZ_DCAH_LOW; // DCAEVT1 = DCAH low(will become active as Comparator output goes low)
EPwm1Regs.DCACTL.bit.EVT1SRCSEL = DC_EVT1; // DCAEVT1 = DCAEVT1 (not filtered)
EPwm1Regs.DCACTL.bit.EVT1FRCSYNCSEL = DC_EVT_ASYNC; // Take async path
EPwm1Regs.TZSEL.bit.DCAEVT2 = 1;
EPwm1Regs.TZCTL.bit.DCAEVT1 = TZ_FORCE_HI; // EPWM1A will go high
// My question here: I'm coding cycle-by-cycle but I needed to set DCAEVT1. Why this is not DCAEVT2 ?