Other Parts Discussed in Thread: CONTROLSUITE
Context: I'm using a Piccolo 28023. I'm using EPWM2A and EPWM1A as a PWM outputs and I'm using DCAEVT1 of both to control those outputs.
The problem:
I configured COMP1A pin to protect both EPWM2A and EPWM1A outputs. I've configured COMP1 and
I tested Comp1Regs.COMPSTS.bit.COMPSTS and COMP1 is working. (I swith voltage at COMP1A pin and COMPSTS changes accordingly)
Than "I connected" COMP1 output to module TZ:
EPwm2Regs.DCTRIPSEL.all = 0x0080;
// DCALCOMPSEL = COMP1out; and DCAHCOMPSEL = !TZ1 input
Then connected DCAL to DCAEVT2 using TZDCSEL:
EPwm2Regs.TZDCSEL.all = 0x0022;
// 0000 xxxx xxxx xxxx = bits 15-12, not used
// xxxx 000x xxxx xxxx = bits 11-9 (3 bits) = DCBEVT2 , 000 = not used
// xxxx xxx0 00xx xxxx = bits 8-6 (3 bits) = DCBEVT1 , 000 = not used
// xxxx xxxx xx10 0xxx = bits 5-3 (3 bits) = DCAEVT2 , 100 => DCAEVT2 = DCAL high
// xxxx xxxx xxxx x010 = bits 2-0 (3 bits) = DCAEVT1 , 010 => DCAEVT1 = DCAH high
// So DCAEVT2 should be 1 when COMP1 is 1.
Then connected DACEVT2 to DCAEVT2.force:
EPwm2Regs.DCACTL.all = 0x0008;
// xxxx xx0x xxxx xxxx = bit 9 = EVT2FRCSYNCSEL , DCAEVT2 Force Synchronization
// 0 Source Is Synchronous Signal
// 1 Source Is Asynchronous Signal
// (0, source is sync signal)
// xxxx xxx0 xxxx xxxx = bit 8 = EVT2SRCSEL, DCAEVT2 Source Signal Select
// 0 Source Is DCAEVT2 Signal
// 1 Source Is DCEVTFILT Signal
// (0, no filter, DCAEVT2.force = DCAEVT2 in)
First problem here:
TZFLG[DCAEVT2] does not receive nothing. Signal of COMP1 does not arrive here.
Finally connecting DCAEVT2.force to TZ:
EPwm2Regs.TZCTL.all & 0x0FFF) != DISK_0x0F7D;
// 0000 1111 0111 1101 - 0x0F7D
// 0000 .... .... .... - unused
// .... 11.. .... .... - (11): DCBEVT2 do nothing
// .... ..11 .... .... - (11): DCBEVT1 do nothing
// .... .... 01.. .... - (01): DCAEVT2 provoques EPWM2A = 1 (IGBT turn off)
// .... .... ..11 .... - (11): DCAEVT1 do nothing
// .... .... .... 11.. - (11): TZB do nothing
// .... .... .... ..01 - (01): TZA provoques EPWM2A = 1 (IGBT turn off)
This does not work because signal never arrives to TZFLG[DCAEVT2].
I rechecked my code and I can't figure out why TZFLG[DCAEVT2] does not receive anything. Always 0.
I think I've interpreted something wrongly.
Any help is appreciated.