• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » How to manage a Trip Zone with 2 comparators
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    How to manage a Trip Zone with 2 comparators

    This question is not answered
    Nicolas UHL
    Posted by Nicolas UHL
    on May 02 2012 11:59 AM
    Prodigy60 points

    Hi,

    I have a problem with the Trip Zone / ePWM module for my application.

    I have a single PWM output (PWM1A) and I want to force this output low on 2 conditions (One Shot Trip Event):

    - COMP1 output tripped 

    - COMP2 output tripped

    This is quite simple. (1 PWM output with 1 overcurrent + 1 overvoltage security).

    But it seems that it is impossible to manage this very simple case.

    => I control PWM1A so I have to use Digital Compare Events DCAEVT1 and DCAEVT2 (DCBEVT are not relevant).

    => So I map DCAEVT1 on COMP1, and DCAEVT2 on COMP2.

      BUT !!!!! : DCAEVT2 can only be used as a source for a Cycle By Cycle Trip Zone. I want it to be a OST source.

    So, I guess I misunderstood something. It MUST be possible to shutdown a PWM output from 2 conditions. But I don't know where I'm wrong.

    I would appreciate your help on this matter.

    Thank in advance.

    Nicolas UHL  

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Kris Parrent
      Posted by Kris Parrent
      on May 02 2012 14:37 PM
      Expert5985 points

      Hi Nicholas,

      Which device are you using?

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Nicolas UHL
      Posted by Nicolas UHL
      on May 03 2012 02:33 AM
      Prodigy60 points

      Sorry, I forgot to mention this important point :

      I use a Piccolo TMS320F28035 device.

      Regards

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Kris Parrent
      Posted by Kris Parrent
      on May 03 2012 13:52 PM
      Expert5985 points

      Nicholas,

      Have you had a chance to take a look at Example_2803xEPwmDCEventTrip in controlSUITE?  I believe EPWM1 is configured to be tripped by DCAEVT1 as a one shot trip.

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Kris Parrent
      Posted by Kris Parrent
      on May 03 2012 13:53 PM
      Expert5985 points

      Here's the line of code which specifically controls if it is one shot or cycle by cycle:

      // Enable DCAEVT1 as a one-shot trip source
      // Note: DCxEVT1 events can be defined as one-shot.
      // DCxEVT2 events can be defined as cycle-by-cycle.
      EPwm1Regs.TZSEL.bit.DCAEVT1 = 1;

      Looking back at your code I think I see the problem.  You are using trying to use two different DC events for two events.  What you want to do is configure the DCAH and DCAL for a single event.  You will want to use DCAEVT1 since this can be a one shot trip.

      EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT; // DCAH = COMP1OUT
      EPwm1Regs.DCTRIPSEL.bit.DCALCOMPSEL = DC_COMP2OUT; // DCAL = COMP2OUT

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Nicolas UHL
      Posted by Nicolas UHL
      on May 04 2012 02:16 AM
      Prodigy60 points

      Kris,

      Thanks a lot for your answer.

      But I still have a question.

      DCAEVT1 can be a source for a One Shot Trip on PWMxA. DCAEVT2 can not. So I need to use DCAEVT1. OK.

      I can set, as you suggest, the DCTRIPSEL register:

      EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT; // DCAH = COMP1OUT
      EPwm1Regs.DCTRIPSEL.bit.DCALCOMPSEL = DC_COMP2OUT; // DCAL = COMP2OUT

      By this way I define 2 different signals (DCAH and DCAL).

      BUT : then, how can I define DCAEVT1 to be triggered by DCAH or DCAL (as i want DCAEVT1 to be triggered on 2 conditions).

      The TZDCSEL register does not allow this.

      So, how can I manage it ?

      Thanks in advance.

      Nicolas

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Kris Parrent
      Posted by Kris Parrent
      on May 04 2012 10:16 AM
      Expert5985 points

      Nicolas,

      That makes more sense.  I thought this was a strange condition looking for both over voltage and over current simultaneously, but I've been asked stranger things :)

      I think you may have some confusion with which DC events can be OSHT and which can be CBC.  If you checkout the TZSEL bit descriptions on pg 122 of the previously linked to document, you will see that DCAEVT1 and DCBEVT1 can both be configured as OSHT trip sources.  DCAEVT2 and DCBEVT2 can both be CBC trip sources.

      Do you have DCBEVT1 available to use?

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Nicolas UHL
      Posted by Nicolas UHL
      on May 04 2012 10:49 AM
      Prodigy60 points

      Kris,

      Yes, DCBEVT1 is available. But the issue is still alive.

      Because, DCBEVT1 can only manage a PWMxB output (when I refer to the TZCTL register).

      In my case, I have only one output to manage : PWM1A

      Actually, my need is quite simple : I want to shutdown (in One Shot mode) my PWM1A output when COMP1 trips or when COMP2 trips.

      Thanks in advance.

      Nicolas

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Kris Parrent
      Posted by Kris Parrent
      on May 04 2012 13:33 PM
      Expert5985 points

      Nicolas,

      My mistake, you are correct.  What I would suggest doing is configure DCAEVT2 as CBC and software force a oneshot trip in the ISR before you clear the CBC trip flag.  The CBC trip will remain in effect until the trip condition clears and TBCLK = 0.  In most cases this should keep your PWM tripped until you have time to force the oneshot trip in the ISR.

      In the meantime, I will speak with some colleagues to see if there is a more direct route to accomplish what you are looking to do.

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use