This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Hi C2000 Concerto Tripzone oneshot problem

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

  • Hi Tom Chen,

    What is the status of the Trip input signal?
    It is possible that the Trip may be getting set again immediately - though you are clearing in the software.
    Please check the source of the Trip signal.

    -Bharathi.

  • Hi Tom,

    I think your answer depends on what you're trying to accomplish by using the Trip Zones.  Are you (A) hoping to trip immediately based on external signals or (B) is it good enough to reading the external signal via ADC, use software to check the value, then force a stop of the PWM.

    If (B), commenting out the line of code is fine.

    If (A), I will refer to Figure 7-37 (Trip-Zone Submodule Mode Control Logic) and Figure 7-46 (GPIO MUX-to-Trip Input Connectivity) in the current TRM (SPRUH22G).

    I think the root cause of your problem is this:  that setting TZSEL to OSHT1 allows TZ1 (a digital signal) to trip the ePWM.  Note that TZ1 is, by default, set to GPIO00 (via the GPTRIP1SEL register bit).  If you set GPTRIP1SEL to some GPIO which is pulled high, my guess is that you will start seeing your PWM work as you expect.

    Note that the internal comparators can be used to generate a trip without software intervention and based on an analog signal.  To do this, you'll need to understand Figure 7-37 well and also the Digital Compare submodule.


    Thank you,
    Brett

  • Thanks , I have solve that problem by the following
    EALLOW;
    GpioG1TripRegs.GPTRIP1SEL.bit.GPTRIP1SEL = 12 ; //Select PD0_GPIO12 as TZ1n (from the pinout)
    EDIS;
    and
    GpioG1DataRegs.GPASET.bit.GPIO12 = 1; // uncomment if --> Set High initially

    Thank you