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.

TMS320F28377S: EPWM Trip Zone question

Part Number: TMS320F28377S

Hello TI community,

I am currently trying to control my ePWM using GUI composer. Ideally, I'd like to toggle a switch an see my ePWM stop. I ran into this idea initially when I saw my pwm turning on automatically for a couple of second on power up before turning off. I believe this is due to my initialization of my ePWM code. I would like to be able to initialize my ePWM for his baud rate, high resolution, and etc without having to have the PWM turn on. That's when I saw trip zone. From my understanding there are three types of tripping. One shot, cycle by cycle, and digital compare. The example code cover one shot and cycle by cycle, using a GPIO pin as the tripping condition. I understand that the tripzone 1 is connected to the input1 of the input x-bar which is why when I the particular GPIO pin goes low, the trip is detected. I was wondering, however, if it would be possible to use a global variable controlled by GUI composer to be a trip condition?

  • Hello,

    In general, the Input X-Bar is configured (like the example project you mentioned) or digital compare events are generated for trip events to occur.
    I'll look into this and let you know.

    Regards,
    Elizabeth
  • Hi Brenden,

    I'm not very familiar with GUI Composer (although I would like to be!) but I'll give you some suggestions on the PWM issue, then we can pull another person in for the GUI question. You said:

    " I believe this is due to my initialization of my ePWM code. "

    When you are configuring your PWM, there is an option to have the TBCTR "frozen" until you actually want the PWM to start. You definitely want to use this feature until everything is configured and setup the way you want it. This will prevent spurious outputs on the PWM. The same results can be achieved using TBCLKSYNC to gate the TBCLKs to all the PWM modules.

    Trip zone is still a valid option for this, but if that is the only problem you are looking to solve I don't think it's necessary. However, if you want to be able to turn off your PWMs at any time, then a trip is the way to go. In this case, what you'll want to do is have the GUI somehow write to the TZFRC register. If GUI Composer can write to an address instead of a variable (I imagine it can) then this should be pretty straight forward. Turning them back on would involve writing to the TZCLR register.

    Regards,
    Kris
  • Brenden,

    You can use Code Composer Studio to find the address of the registers. Go to the register view and then right click on the register you are interested in, select to open at the address.

    Then in GUI Composer choose to add an empty container. Then at the top right of GUI Composer select the 2 horizontal arrows. This will open the widget palette. From there you can add a number box and bind it to the address. Add a second box for the other register. When running your GUI composer app entering a value will then right to that address.

    Regards,
    John