• 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 disable TMS320C28x EPWM output?
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 disable TMS320C28x EPWM output?

    This question is answered
    violet han
    Posted by violet han
    on Apr 26 2012 22:23 PM
    Intellectual325 points

    Hello everyone,

    I'm using C2808 as a digital controller  with its EPWM configured as PWM signals. I configure the EPWM deadband as "DB_ACTV_HIC" so EPWMxA and EPWMxB are in pairs. However, I find there maybe two problems in this mode:

    1) If I click "halt" in emulation, the EPWM still stop work but still keeps output as "complement output" - i.e, one is high, the other is low. But this may damage my hardware.  Could anyone tell me a way to make both of them "output low" in HALT?

    2) Assuming an interrupt comes while the EPWM A/B pair is working normally, how shall I quickly stop the EPWM with both of them "output low" in the interrupt? I tried to disable the EPWM clock but it seems not work.  Can anyone help me on this?

     

    Thank you very much in advance,

    Violet

     

     

     

    C28x EPWM Deadband DB_ACTV_HIC
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Kelvin Leung
      Posted by Kelvin Leung
      on Apr 27 2012 02:02 AM
      Prodigy20 points

      I have the exact same question.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daniel Chang
      Posted by Daniel Chang
      on Apr 27 2012 14:35 PM
      Expert4120 points

      1) Depending on your needs, you could configure the PWMs in FREE-RUN mode.  This is done in the PWM TBCTL register.  This will allow the PWM timers to continue to run while the program is paused and prevent your PWMs from getting stuck constantly high/low.

      2) Once you are in the interrupt, you could try using a continuous SW force, using the  AQCSFRC register.  Depending on the interrupt source, you could potentially configure your PWM modules to automatically trip and go low.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • violet han
      Posted by violet han
      on Apr 28 2012 00:42 AM
      Intellectual325 points

      Thank you for reminding me this. I'm referring to SPRU791F which I think is similar to SPRUGE9.  Maybe I didn't understand trip-zone part well. I'll try to look at it again.

      Regarding to question 2), I noticed the CCS debug tool provides an option as "halt at program termination (requires setting a breakpoint)"  So I'd like to know if there is a way to make the program stop from "free run" to a defined "breakpoint" as I defined when I click "halt".   Or if that option doesn't mean like what I imagine, Pls correct me.

      Thank you,

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daniel Chang
      Posted by Daniel Chang
      on Apr 30 2012 16:19 PM
      Expert4120 points

      Sorry, I did not see that you are using C2808.  That is a different device than F2802x. 

      SPRU791 is the correct user guide to refer to.  Do not use SPRUGE9.

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daniel Chang
      Posted by Daniel Chang
      on Apr 30 2012 16:37 PM
      Expert4120 points

      Regarding 2) I am not sure if you can pre-set a location to "halt" at.  You can try asking in the CCS Support Forums. 

      What you can try is setting the breakpoint when you want to halt.  This way the device will stop at the breakpoint like it would for any regular breakpoint.  Another option is to try setting the breakpoint ahead of time, but disable it during run. When you want to halt, you can re-enable the breakpoint.

      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 Apr 30 2012 17:24 PM
      Expert5985 points

      You can also hard code a breakpoint in software by using the 

      asm(" ESTOP0");

      command.

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daniel Chang
      Posted by Daniel Chang
      on Apr 30 2012 18:55 PM
      Verified Answer
      Verified by violet han
      Expert4120 points

      Kris Parrent

      You can also hard code a breakpoint in software by using the 

      asm(" ESTOP0");

      command.

      Kris

      To add on to what Kris said, you could do what he suggested inside of  an IF statement.  That way, if you want to halt, you can toggle a variable during run-time to trigger the halt.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • violet han
      Posted by violet han
      on May 01 2012 20:57 PM
      Intellectual325 points

      Daniel, Kris, Thank you so much for your suggestions.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Edward Jakob1
      Posted by Edward Jakob1
      on Jul 05 2012 16:22 PM
      Prodigy245 points

      According to my findings, option (1) does not always work.  In ePWM asymmetric mode, the ePWM module will count up or down to the end of a switching cycle, then the ePWMxA and ePWMxB pins may be manipulated per the AQCTRLx registers. In ePWM symmetric mode, the TMS320F2809 stops when the TBCTR = TBPRD, which is right in the middle of the ePWM switching cycle.  As a result, one of the ePWMx pins is pulled logic HIGH and the other logic LOW.  

      I have no solution for this problem on the TMS320F2809 when using the ePWM modules in symmetric mode.  If you hear of one, please let me know.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • violet han
      Posted by violet han
      on Jul 05 2012 21:18 PM
      Intellectual325 points

      Yes, I agree with you. Option(1) doesn't always work.  I think setting EPWM TZ interrupts(either by HW or software) can force both outputs low. So maybe you can set an externally "trig signal" to force PWM low.

      Good luck,

      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 Jul 06 2012 10:01 AM
      Expert5985 points

      Violet is on the right path.  You can configure these for a ONESHOT trip and force the outputs to a known state.  Setup some sort of variable in your main() loop which you can set from the watch window:

      if(about_to_halt == 1)

      {

           EPwm1Regs.TZFRC.OST = 1;

           EPwm2Regs.TZFRC.OST = 1;

           .... etc

           asm(" ESTOP0");  // Automatically halts the emulation, then you can clear your OST trip flags afterwards

           // Clear trip flags here so when you resume emulation PWM outputs are active again

      }

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Edward Jakob1
      Posted by Edward Jakob1
      on Jul 06 2012 13:39 PM
      Prodigy245 points

      Thanks Kris, Violet.  

      This solution has a ring of familiarity to it.  It appears I cannot deassert the ePWMxA and corresponding ePWMxB pins during a normal emulation halt; it must be accomplished using a variable which can be updated in a watch window while CCS is operating in a real-time mode of execution.

      So why hasn't SPRU791 table 4-4 (FREE/SOFT bits) been updated to reflect this?  Even the latest version associated with the Piccolos, SPRUH18C, still reflects that ePWM modules can configure FREE/SOFT to '01' to allow the module to stop after an entire symmetric switching cycle when an emulation halt has been issued. 

      SPRU791 is inconsistent with the actual operation of the TMS320F2809
      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 Jul 06 2012 14:18 PM
      Expert5985 points

      Edward,

      This is correct.  On later devices we have added an EMUSTOP trip which can set the PWMs to a known state on an emulation halt.  However, for this device this is a workaround to accomplish the same result.

      The FREE_SOFT bits are not intended to force the PWMs to a known state.  It may be able to be used this way depending on where your PWMs are toggled, but if your PWMs are configured to be complimentary this will not provide you with the functionality to set them both low on emulation halt.  The benefit of these bits are you can maintain the desired duty cycle / PWM relationships before and after an emulation halt.

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Edward Jakob1
      Posted by Edward Jakob1
      on Jul 07 2012 17:34 PM
      Prodigy245 points

      Thanks Kris.  My main concern was that SPRUH18C (the latest peripherals user's guide associated with the TMS320F28069) does not reflect how FREE/SOFT affects the ePWM channels at the end of a PWM switching cycle.

      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 Jul 09 2012 16:20 PM
      Expert5985 points

      Edward,

      Not sure I'm following the problem with the description of these bits.  Can you elaborate?

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    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