你们好,
我现在用F28069的TZ故障。当正常时,TZ信号为高电平,有PWM输出;当TZ信号为低电平时PWM一直关闭。我想做成发生TZ触发后PWM关闭10S后,如果TZ信号正常了,PWM可以有输出。也即怎么让TZ出发后,然后TZ故障消除了,停上10S再启动。
EALLOW;
// CPU Halt Trip EPwm1Regs.TZSEL.bit.CBC6=0x1;
EPwm2Regs.TZSEL.bit.CBC6=0x1;
EPwm3Regs.TZSEL.bit.CBC6=0x1;
EPwm1Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm2Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm3Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT
// What do we want the OST/CBC events to do?
// TZA events can force EPWMxA
// TZB events can force EPWMxB
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EDIS;
// Clear any spurious OV trip
EPwm1Regs.TZCLR.bit.OST = 1;
EPwm2Regs.TZCLR.bit.OST = 1;
EPwm3Regs.TZCLR.bit.OST = 1;
if(EPwm1Regs.TZFLG.bit.OST==0x1) // TripZ for PWMs is low (fault trip)
{ TripFlagDMC=1; GpioDataRegs.GPBTOGGLE.bit.GPIO42 = 1;
}
Seven Han:
请问您的问题具体是什么?不是太明白。
你们好,
我现在用F28069的TZ故障。当正常时,TZ信号为高电平,有PWM输出;当TZ信号为低电平时PWM一直关闭。我想做成发生TZ触发后PWM关闭10S后,如果TZ信号正常了,PWM可以有输出。也即怎么让TZ出发后,然后TZ故障消除了,停上10S再启动。
EALLOW;
// CPU Halt Trip EPwm1Regs.TZSEL.bit.CBC6=0x1;
EPwm2Regs.TZSEL.bit.CBC6=0x1;
EPwm3Regs.TZSEL.bit.CBC6=0x1;
EPwm1Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm2Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm3Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT
// What do we want the OST/CBC events to do?
// TZA events can force EPWMxA
// TZB events can force EPWMxB
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EDIS;
// Clear any spurious OV trip
EPwm1Regs.TZCLR.bit.OST = 1;
EPwm2Regs.TZCLR.bit.OST = 1;
EPwm3Regs.TZCLR.bit.OST = 1;
if(EPwm1Regs.TZFLG.bit.OST==0x1) // TripZ for PWMs is low (fault trip)
{ TripFlagDMC=1; GpioDataRegs.GPBTOGGLE.bit.GPIO42 = 1;
}
mangui zhang:结合复位信号在硬件上实现触发后同时进行复位
有一些复位芯片通过电容大小可以做到一定的延时
你们好,
我现在用F28069的TZ故障。当正常时,TZ信号为高电平,有PWM输出;当TZ信号为低电平时PWM一直关闭。我想做成发生TZ触发后PWM关闭10S后,如果TZ信号正常了,PWM可以有输出。也即怎么让TZ出发后,然后TZ故障消除了,停上10S再启动。
EALLOW;
// CPU Halt Trip EPwm1Regs.TZSEL.bit.CBC6=0x1;
EPwm2Regs.TZSEL.bit.CBC6=0x1;
EPwm3Regs.TZSEL.bit.CBC6=0x1;
EPwm1Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm2Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm3Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT
// What do we want the OST/CBC events to do?
// TZA events can force EPWMxA
// TZB events can force EPWMxB
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EDIS;
// Clear any spurious OV trip
EPwm1Regs.TZCLR.bit.OST = 1;
EPwm2Regs.TZCLR.bit.OST = 1;
EPwm3Regs.TZCLR.bit.OST = 1;
if(EPwm1Regs.TZFLG.bit.OST==0x1) // TripZ for PWMs is low (fault trip)
{ TripFlagDMC=1; GpioDataRegs.GPBTOGGLE.bit.GPIO42 = 1;
}
user5611825:
回复 Seven Han:
请问一下老师,这个TZ的触发方式在TMS320F28027芯片里写死了吗?是只能低电平触发吗
你们好,
我现在用F28069的TZ故障。当正常时,TZ信号为高电平,有PWM输出;当TZ信号为低电平时PWM一直关闭。我想做成发生TZ触发后PWM关闭10S后,如果TZ信号正常了,PWM可以有输出。也即怎么让TZ出发后,然后TZ故障消除了,停上10S再启动。
EALLOW;
// CPU Halt Trip EPwm1Regs.TZSEL.bit.CBC6=0x1;
EPwm2Regs.TZSEL.bit.CBC6=0x1;
EPwm3Regs.TZSEL.bit.CBC6=0x1;
EPwm1Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm2Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm3Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT
// What do we want the OST/CBC events to do?
// TZA events can force EPWMxA
// TZB events can force EPWMxB
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EDIS;
// Clear any spurious OV trip
EPwm1Regs.TZCLR.bit.OST = 1;
EPwm2Regs.TZCLR.bit.OST = 1;
EPwm3Regs.TZCLR.bit.OST = 1;
if(EPwm1Regs.TZFLG.bit.OST==0x1) // TripZ for PWMs is low (fault trip)
{ TripFlagDMC=1; GpioDataRegs.GPBTOGGLE.bit.GPIO42 = 1;
}
Aki Li:
回复 user5611825:
是的,手册里有说明
The trip-zone signals at pins TZ1 to TZ6 (also collectively referred to as TZn) are active low input signals.
你们好,
我现在用F28069的TZ故障。当正常时,TZ信号为高电平,有PWM输出;当TZ信号为低电平时PWM一直关闭。我想做成发生TZ触发后PWM关闭10S后,如果TZ信号正常了,PWM可以有输出。也即怎么让TZ出发后,然后TZ故障消除了,停上10S再启动。
EALLOW;
// CPU Halt Trip EPwm1Regs.TZSEL.bit.CBC6=0x1;
EPwm2Regs.TZSEL.bit.CBC6=0x1;
EPwm3Regs.TZSEL.bit.CBC6=0x1;
EPwm1Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm2Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT EPwm3Regs.TZSEL.bit.OSHT1 = 1; //enable TZ1 for OSHT
// What do we want the OST/CBC events to do?
// TZA events can force EPWMxA
// TZB events can force EPWMxB
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EDIS;
// Clear any spurious OV trip
EPwm1Regs.TZCLR.bit.OST = 1;
EPwm2Regs.TZCLR.bit.OST = 1;
EPwm3Regs.TZCLR.bit.OST = 1;
if(EPwm1Regs.TZFLG.bit.OST==0x1) // TripZ for PWMs is low (fault trip)
{ TripFlagDMC=1; GpioDataRegs.GPBTOGGLE.bit.GPIO42 = 1;
}
user5611825:
回复 Aki Li:
谢谢