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.

collision between trip zone definition

Expert 1570 points

Hi,

I'm using the 28069.

What happens if, for example, I set the one-shot to set low on both A and B, and I set DCA/BEVT1 to set high on A and B, and then both events happen at the same time ?

Which event "wins" ?

In the datasheet, on the trip-zone description chapter, Figure 3-39, it shows that both signals enter "trip logic", but then it is not elaborated further.

Can you please explain what will happen?

Thanks

  • Hi Mojo,

    Below is the priority defined in TRM in section 3.2.9.3.1 Digital Compare Events.

    Output EPWMxA: TZA (highest) -> DCAEVT1 -> DCAEVT2 (lowest)
    Output EPWMxB: TZB (highest) -> DCBEVT1 -> DCBEVT2 (lowest)

    -Bharathi.
  • Hi Bharathi,

    Thanks a lot. I missed that definition.

    What I'm trying to do is to force the PWM (using software force) into different states using both OST and DCA/BEVT1 (each one defines a different state on A,B), using TZFRC.

    I cannot use AQCSFRC, as I need to have a quick response and I can't wait for the next counter cycle. Furthermore, it creates a problem if the deadband is active.

    Forcing using the OST is working, but it seems that using the force on DCA/BEVT1 doesn't do anything.

    I can see in TZFLG that the DCA/BEVT1 has occured, but the PWM is not forced to the state I defined.

    I'm configuring the DCA/BEVT1 in two places:

    1. TZSEL - Enable DCA/BEVT1 as one-shot-trip source.

    2. TZCTL - Set DCA/BEVT1 to do what I need (A low, B high)


    Is that the correct method to implement what I need?

    Thanks

  • Once you choose DCA/BEVT1 as OST trip source in TZSEL - then the action defined in TZCTL[TZA/TZB] will take effect.
    So, the action defined for DCA/BEVT1 will not take effect on PWM. If you do not enable DCA/BEVT1 as OST or CBC trip source in TZSEL then the action then the DCA/BEVT1 action will take effect.

    -Bharathi.

  • Hi,

    Ok, so I tried what you suggested (set the DC only in TZCTL, not in TZSEL). At first it didn't work.

    I found that the appropriate setup needs to be done also in TZDCSEL.

    Playing with the bits, I found that only 4 or 5 in EPwm1Regs.TZDCSEL.bit.DCAEVT1 will trigger the required action.

    So that is when DCBL= high.

    Can you please explain the behavior and refer me to the respective location in the TRM that defines this?

    Thanks

    **EDIT:

    I found also that writing to the TZCLR bits for clearing the DCEVT doesn't work. If I try to clear for example the OST it's working... What is the proper way of clearing a the DCEVT flags?

  • Hi,

    You can refer to the following sections of TRM:

    3.2.7.3 Operational Highlights for the Trip-Zone Submodule
    3.2.9.2 Controlling and Monitoring the Digital Compare Submodule
    3.2.9.3.1 Digital Compare Events

    Regarding TZCLR, If the DCEVT is active the flag will get set again. The source event has to go away for the flag to remain cleared.
  • Hi,

    Thanks for the reference.

    Ok so for the DC event to work, I need to configure something in DCTRIPSEL.

    Since I'm only using the DC as a method to asynchronously disable the PWMs, what should I configure in DCTRIPSEL?

    TZ1,2,3 are used for something else for OST...

    Can I generate a constant and reliable output from COMP1OUT, without enabling the peripheral (such as clock etc) ?

    If so, then I will set it for a constant, e.g. '1' then I can toggle the setup in TZDCSEL (i.e. set it to "DCBL = high, DCBH = low" , and then to "event disabled") ?

    This method will serve as a "force" workaround.

    Otherwise, I don't see a way not to set anything in TZDCSEL (which I don't care), and in DCTRIPSEL (which I also don't care)...

    Thanks

  • If you need to set a constant state of PWM using DC event - you could do the above.


    Since I'm only using the DC as a method to asynchronously disable the PWMs, what should I configure in DCTRIPSEL?

    >> Figure 14-49. ePWM Trip Input Connectivity. You can configure EPWM X-Bar to connect the comparator output to the TRIPn.
    Depending on with TRIPn you have chosen, you need to configure DCTRIPSEL accordingly.

    Can I generate a constant and reliable output from COMP1OUT, without enabling the peripheral (such as clock etc) ?

    >> Yes. You can. 


    If so, then I will set it for a constant, e.g. '1' then I can toggle the setup in TZDCSEL (i.e. set it to "DCBL = high, DCBH = low" , and then to "event disabled") ?

    >> You could do this as well.

  • Hi,

    There is no figure 14-49. Can you please re-check?

    How do I configure the COMP1OUT to a constant output?

    Thanks

  • Hi Mojo,

    Sorry about that - I believe you are using F28069, I referred diagrams from a different device TRM.

    For this part, details in Figure 3-47. Digital-Compare Submodule High-Level Block Diagram and Section 3.2.9 Digital Compare (DC) Submodule
    which I'm sure you would have referred already.

    For COMP1OUT you can apply a constant input voltage and set a constant DAC reference. Refer to Figure 8-39. Comparator Block Diagram.

    Cheers,
    Bharathi.