• 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 » Overlapping PWMs triggered by external stimulus
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?
  • InstaSPIN Simulation Tool
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    Overlapping PWMs triggered by external stimulus

    This question is answered
    Mike Volzer
    Posted by Mike Volzer
    on May 03 2012 08:19 AM
    Intellectual540 points

    Hello,

    I'm trying to accomplish creating two PWMs triggered by an external stimulus. The signals need to overlap by a software controlled amount of time (x). The picture below shows the signals that I'm trying to generate with respect to the stimulus.

    I've been looking at the Piccolo device's PWM module and it is not obvious to me that this can actually be done. Can you please give me some insight on how this can be done if at all.

    The stimulus will switch no faster than 500 Hz. I'm looking for the value of x to be on the order of microseconds. I also need to make sure the timing is reliable cycle to cycle.

    Thanks for your help.

    Mike

    Piccolo overlap PWM
    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 03 2012 14:27 PM
      Expert6005 points

      Mike,

      Take a look at the deadband submodule in the Piccolo ePWM user's guide.  

      http://www.ti.com/lit/ug/spruge9e/spruge9e.pdf

      This will allow you to configure the waveforms to just be complimentary, and add "dead" periods inbetween transitions.  It will result in the behavior your are looking for.  We have some deadband examples available in controlSUITE as well.  You would need to configure an interrupt to setup the deadband according to the stimulus though.

      This may be possible using a DCEVT as well, but I will need to put some more thought into it.  If the external stimulus was either active low or active high you could pretty easily use a basic cycle by cycle trip to do this.

      Can you elaborate more on how the PWM outputs reflect the stimulus?  For example, is OUT1 ALWAYS high (except for the period x after the transition) while the stimulus is high?  Is OUT2 always opposite the stimulus (except for transition periods)?

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Mike Volzer
      Posted by Mike Volzer
      on May 03 2012 15:05 PM
      Intellectual540 points

      Kris,

      I'll take another look at the deadband module. It is also important to note that the frequency of the stimulus can change at any time.

      Kris Parrent
      For example, is OUT1 ALWAYS high (except for the period x after the transition) while the stimulus is high?

      OUT1 is ALWAYS high while the stimulus is high. When the stimulus transitions high to low after x seconds OUT1 goes low.

      Kris Parrent
      Is OUT2 always opposite the stimulus (except for transition periods)?

      OUT2 is ALWAYS high while the stimulus is low. When the stimulus transitions low to high after x seconds OUT2 goes low.

      The result of adding in the delay is so that the PWMs overlap by x seconds. So I suppose this is the opposite of a deadband.

      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 15:31 PM
      Expert6005 points

      Thank you.  I better understand your question now.  I'm going to play with this a bit before I throw out what I'm thinking.  I'll get back to you on the results.

      Just to clarify, the deadband will hold the value of the PWM for a defined length past where the normal edge would be, so it can be a high or low signal.

      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 16:48 PM
      Verified Answer
      Verified by Mike Volzer
      Expert6005 points

      There's a couple ways to do this.  The best solution I have at the moment is to connect your stimulus signal to the eCAP (you could probably use the ADC too, but I'm not as familiar with it).  You can configure the eCAP to interrupt on every changing edge and use this interrupt to force the PWM output to a specified state in the action qualifier by using the AQCSFRC register.  You can then use our usdelay() function to achiever your required delay, and force the other output low using the AQCSFRC register after the delay completes.  This is the easier way to implement but is somewhat manual.

      If you want the more complex route, still use the eCAP interrupt, but now use two PWM modules (i.e. EPwm1A and EPwm2A).  Now each eCAP ISR you use the force register to set each PWM output to the desired state.  This will affect the output from the action qualifier submodule which then sends the signals to the deadband submodule (reference Figure 20 http://www.ti.com/lit/ug/spruge9e/spruge9e.pdf).  Now if you configure the deadband submodule to have the desired falling edge delay on each of these PWM outputs, it will automatically take care of the delay for you whenever the corresponding signal has a falling edge.  This saves you from having to wait on the usdelay() function and doing another force.

      Please let me know if you have any questions.  There will be some small delay between the time of your stimulus and the time the output is seen on the PWMs.  But since you are only using a 500 Hz signal, it should be insignificant.  Does this seem acceptable?

      Kris

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Mike Volzer
      Posted by Mike Volzer
      on May 04 2012 07:43 AM
      Intellectual540 points

      Hi Kris,

      Thanks for your help. I'm working on testing this out on a ControlCARD today. I'll let you know if I run in to any problems.

      Mike

      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