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.

TM4C1294NCPDT: Dead-band for PWM in TI-RTOS

Part Number:
TM4C1294NCPDT

I am currently running TI-RTOS on my controller and driving three LED's via PWM. I would like to use the dead-band generator to keep the three PWM's different from each other. I have gone through the example code for driving PWM and another example for generating the PWM's through the dead-band generator. The API's getting involved are from two different library files,

TivaWare_C_Series-2.1.1.71b/driverlib/pwm.h

extern void PWMDeadBandEnable(uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise, uint16_t ui16Fall);

tidrivers_tivac_2_16_00_08/packages/ti/drivers/PWM.h
the above file is used in TI-RTOS example where the PWM handle is used to make the necessary changes for controlling the PWM, where no specific API is available for dead-band generation
I have two queries here,

1. How to use the dead-band generation in case of running PWM via TI-RTOS?

2. The dead band generator gives an output of two different signals, if needed to drive three signals what is the method to generate?

  • Hi Mohammed,

      The TI-RTOS doesn't have functions to support the dead-band feature offered by the hardware. You will need to call the TivaWare API to configure the dead-band. Please find below link to TI-RTOS support for Tiva device on the PWM module. 

    Each PWM module contains 4 PWM generator blocks and each PWM generator block produces two PWM signals that share the same timer and frequency as pwmA and pwmB. The dead-band feature allows the two coupled signals (pwmA and pwmB) to produce two PWM signals with programmable dead-band delays. If you need to produce dead-band among three signals then you will need to utilize another PWM generator block for a total of two generator blocks.  I think somehow you will need to configure the two PWM generator blocks with the same timebase and synchronize them to produce the desired result.  

      

      

  • Mohammed Zakariya said:
    I would like to use the dead-band generator to keep the three PWM's different from each other.

    Vendor has provided fast & valid PWM detail.

    However - my small Tech Group has a (much) different take:

    • Such 'Deadband' is most usually employed when the PWM Signals are 'Complementary' - and  'Drive a, 'Power-Stage' - via an 'efficiency technique' known as, 'Synchronous Rectification.'
      • Under this condition - the deadband imposes guaranteed OFF-Time - upon both PWM-A & PWM-B (w/in the same PWM Generator.)
      • We do not believe that the MCU Manual clearly notes that such 'Complementary' PWM Mode (may only) be achieved by, 'Enabling the Deadband Generator!'
      • Complementary PWM forces 'PWM-A & PWM-B' to be 180° out of phase.   Software then drives only one of those PWM outputs - the remaining output becomes, 'Inversely Slaved.'
      • Deadband IS required in most all Power Stages - as most exhibit, 'Differing Power Semiconductor Turn-On & Turn-Off times!'     Thus it becomes possible (often likely) that (both) the High-Side & Low Side Power Devices are, 'On together!'    This is well known - and is noted as, 'Shoot-Thru' - usually resulting in (near) unlimited current flowing (almost entirely) thru both (Hi & Lo) Power Devices.  (And NOT to the Load!)    Destroying the Power Devices - and often (even) damaging the pcb & other components.
      • Deadband attempts to 'compensate for those different Turn/On/Off times'  (encountered while the  'Complementary PWM Stage' is 'Switching') - by enforcing a, 'Programmable Guaranteed OFF Time' - upon both the High & Low Side Power Devices.   In this manner - the chance of both (Hi & Lo Sides) being on together - is greatly reduced.    Even though - and especially though - 'ON/OFF times' of the PWM-Driven Power Devices differ!

    • Now your application is not seen as involving such a High, 'Power Stage.'    Thus there appears 'little harm' - should (the usually dreaded) 'Shoot-Thru' occur.    And - in your case - 'Deadband proves a liability - offering NO Advantage.   (indeed - it (even) renders one of your PWM Outputs (essentially) worthless!)

      • And in fact - as Vendor's Charles notes - a single PWM Generator can drive 2 Leds - with (either) the same - or completely different 'Duty Cycles!'
      • Note too - you seek to drive 3 Leds - thus a 2nd PWM Generator will be required.   (yet only one of its two outputs)   And again as Charles states - you may adjust that 2nd PWM Generator to the same frequency as the 1st one.   You thus wind up w/3 distinct, Programmable, PWM Outputs - each one capable of 'Independent Duty Cycle!'

    As the above (hopefully) illustrates - 'Deadband' proves 'Not your friend' in such application!   (as deadband creates an 'Unwanted Linkage' between 2 PWM Outputs - which is outside your stated goal of 'PWM Independence!'

    Tag: Poster's Goal was fine - his 'method' ... (pardon) perhaps, 'Not so much!...'

  • Presented here is a, 'Scope-Cap' of a 'PWM Generator employing deadband.'    Note that the lower trace (blue) is the 'Slave' of the upper one - and cannot be individually adjusted.   (to a desired duty cycle)   

    It is important to note that w/in a single PWM Generator - employing deadband - never/ever are both signals allowed to be 'logic high' in unison.   (i.e. together)    In this capture - both deadband 'edges' (leading & trailing) are equal - and both are programmable.

    When the deadband parameters are (both) set to '0' - the blue waveform is the (exact) inversion of the yellow.    (yet still - never are both high simultaneously.)

    When and if, 'No deadband is asserted' - then both outputs (from the same PWM Generator) may independently control each channel's duty cycle.   (the frequency is shared)

    It should be (again) noted that the introduction of deadband - when 3 Leds are the 'Target of the PWM' (and arising from 2 separate PWM Generators) such deadband is unnecessary and in fact renders the 'blue trace' (as presented above) 'unusable' for poster's purpose...

    TAG: One picture & 'just under' 1K words...

  • Thanks for the screen captures and the detailed explanation, I understand that using a dead band is not going to help me in controlling the PWMs to drive the LEDs individually. With your earlier reply you mentioned about a Shoot-Thru, this is the exact reason why I am trying to achieve different PWMs. The query raised is with a simple use case, but the actual application is power heavy.

    So going forward without the dead-band generator being used, How do I bring in the control between the three PWMs?

  • My friend - you have  (substantially)  "Moved the cheese" - have you not?     This forces additional time & effort upon Staff & myself - and we have already 'labored mightily' (and we, along w/this vendor, believe effectively) in your behalf!      Should we detail further - what prevents your (then) freshly 'Motorized Cheese' - from 'Driving even more distant?'

    Staff & I are strong proponents of 'KISS' - the specificity demanded proves invaluable (both) in design/development and in 'Diagnosis.'    We note your new request has escalated to 'Power Heavy' - which is 'far outside' your initial  (3 Led) description - and as vendor's Charles has noted - the (now critical) 'Deadband' Control - appears 'unavailable' under this vendor's 'RTOS!'    

    My small tech firm services many far larger firms - both they & our investors 'demand' that we, 'Choose ARM MCUs & Development/Operating Systems which are 'Best Suited to Task & Multi-Vendor Welcoming!'     (Thus never/ever confined to (any) single vendor!)     We have thus never considered this vendor's (so restricted) RTOS - as it proves contrary to our clients' 'Pursuit of Optimization' - likely & most always achieved by 'Casting a (very) Wide (i.e. multi-vendor) Net.'

    If you wish further tech support from my team - kindly 'reward' my post(s) here - and issue a new posting - with the requirement for vendor's (so restricted) RTOS absent.    (FREE RTOS  falls w/in our 'multi-vendor capable' specification.)

    In addition - the new requirement, "application is power heavy" - is devoid of (any) necessary detail - always required by 'KISS!'    Again - it is believed that a, 'New Posting' - adequately detailed and 'Direct in its Request' - proves very much to your advantage...

    TAG:  Cheese suddenly moves - that's not acceptable...

  • Sorry mate, the cheese had to become bigger. Your efforts and quick responses are highly appreciable. I understand the discussion of a Shoot-thru is for another thread, but with this thread the feasibility of a dead-band in a controller running TI-RTOS got discussed which was one of the queries.

    As understandable from your responses the dead-band is not the way to go if I want to drive the LEDs independently. If running them from different generator blocks, is it possible to bring in a sense of control over the highs and lows between the PWMs leaving aside whether the device is run power heavy or not? I hope this can be considered a discussion for this thread.

  • Thank you - too often posters  here delay or abandon their 'Response Obligations' -  you reveal no hint of that travesty.    (And Good that!)

    Mohammed Zakariya said:
    Sorry mate, the cheese had to become bigger.

    Your cleverness & negotiation skills reveal here.    Young staff believes some 'past history' from 'my side' deserves introduction - and follows.   (fast forward around this section if, 'Not of interest.')

    More than a decade past I co-founded a Tech Firm - we 'applied & killed ourselves' - and succeeded beyond our wildest dreams.    Our ability to SELL well out-stripped our 'credit line' - one option was an 'IPO' - which effectively removed our 'credit-pledged' houses from jeopardy.    Our IPO 'Market Maker' (brilliant, young, female attorney) exploited her (large) financial firm's 'savvy' - and was able to anticipate (almost) every issue we'd face.   (Even those technical in nature)    During interviews I noted 'how often' our large clients, 'Moved the Cheese!'   (never/ever 'lightening our design load.)    And these clients 'expected' (even banked upon) our not having the 'experience and/or guts' to 'say No!'    Our attorney/IPO advisor directed me to 'law school' - so that our ability to create (proper) contracts was enhanced.   Thus - ALL of our contracts subsequently noted, 'Any/all changes and/or modifications to the 'base/original' agreed specifications' - are (almost certain) to result in: 'Cost Adders and Delay the Scheduled Delivery Date!'    (and require proper (written) agreement prior to acceptance.)

    You may now (properly) note, Why we resist, 'Any/All thrusts of, 'Had to become bigger!'     This escalation is 'outside that which was initially sought' - we have received no (clearly earned) 'Verify Award' - and have suggested the issue of a 'New, more appropriate request' - upon a fresh forum thread.

    That said - staff wishes to 'bend the rules'  (in your behalf) ... just this once!     (they are all young, gifted, & seek to run their own 'back-room Tech'  -  post their graduation from (the best) colleges.)

    Mohammed Zakariya said:
    If running them from different generator blocks, is it possible to bring in a sense of control over the highs and lows between the PWMs

    Neither they nor I claim to fully grasp, 'That which you're asking (above).'    Once again - your 'brevity' competes w/the provision of full & adequate detail!    One staffer has found a '5+ year post' which I (also) successfully answered - which (may) offer further guidance & insight.

    This scope-cap - along w/careful read/review of poster's 'declared objective' - should clarify.    Note that shown here are the outputs from 2 PWM Generators w/the 2nd Gen simply inverting the output of the 1st Gen.    And that produced  'Unusable power stage control signals!'    (i.e. Destructive control signals - as channels 1 & 4 along w/2 & 3 'drove high' - at the same time.)    (Read deeper into that past post for detail... and an outsider's 'inventive solution.')


    TAG:  Always beware ... 'Feature - Specification  and (even forum request) CREEP!'      Note: it is seriously 'time' for the unleash of multiple Green Ink Flows!