Hi, Im currently implementing the ILPFC F28035 example code to the concerto F28M35 develpment kit
I build the incremental build 1 from the kit IL_PFC
the code
EALLOW;
EPwm1Regs.TZSEL.bit.OSHT1 = 1;
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWM1A will go low
EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWM1B will go low
EDIS;
I find out that the PWM 1would alive
but I implement the same code to the concerto F28M35 platform
(using fixed point, and the M3 side is pinout to control side by device example setup_m3 project))
the PWM is force Low
I check the datasheet from F28M35 it state "once the TZSEL.bit.OSHT1 is set , the TZFLAG is set. and need to be clear after initialization for future trip function.
but I add the code right after the code like this
EALLOW;
EPwm1Regs.TZSEL.bit.OSHT1 = 1;
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWM1A will go low
EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWM1B will go low
EPwm1Regs.TZCLR.bit.OST = 1; // Clear any spurious OC trip
EDIS;
But I still can't clear the TZFLAG to 0 thus the PWM is not alive...
I have no idea how to clear that flag to make the PWM function normally and provide the trip function.
But I do this
EALLOW;
//EPwm1Regs.TZSEL.bit.OSHT1 = 1;
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWM1A will go low
EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWM1B will go low
EDIS;
all of the sudden the PWM comes to alive and the trip function is work properly
( I check the function by set the VBUS_OVP_THRSHLD to a number that cause the TZFRC.bit.OST turn off the PWM)
interrupt void SECONDARY_ISR(void)
{
EINT;
if (VbusAvg > VBUS_OVP_THRSHLD)//Check for Vbus OV Condition; Use for Build 2 & 3
//if (Vbus > VBUS_OVP_THRSHLD)//Use this for Build 1 test
{
OV_flag = 1;
EALLOW;
//EPwm4Regs.TZFRC.bit.OST = 1;//Turn off PWM for OV condition
EPwm1Regs.TZFRC.bit.OST = 1;//Turn off PWM for OV condition
EDIS;
VbusTargetSlewed = 0;
VbusTarget = 0;
pfc_on_flag = 0;
//Gui_Vbus_set = 0;
}
is that okay if I comment out the "EPwm1Regs.TZSEL.bit.OSHT1 = 1;"
or is there better way to do?
thanks in advanced.
Tom Chen