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.

TM4C1294KCPDT: PWM

Part Number: TM4C1294KCPDT
Other Parts Discussed in Thread: ENERGIA

Hi,

Is it possible to define the period of PWM during initialization.?

Or define the status of PWM pins during initialization.

Regards

Nikhil

  • Nikhil KV1 said:

    Is it possible to define the period of PWM during initialization.?

    Or define the status of PWM pins during initialization.     

    Yes - to both questions.    (assumes that 'initialization' is 'sharpened' to  'PWM Module Initialization.'

    • Vendor's API - greatly detailed w/in the 'Peripheral Driver Library' - includes functions which individually 'dictate' (both) the PWM's period & Duty Cycle.    These functions may be invoked during initialization as well as during 'live operation.'
    • Valid 'PWM capable pins' (*) default to 'off/logic low' during their assignment to PWM.    During initialization these may be ordered to 'either' logic state - which occurs upon the  'full enabling' of the PWM Module.

    (*)  only a select number of MCU's GPIOs may perform with 'official' PWM capability.    The MCU's manual fully describes/details.   

  • Hi,

    Without calling PWM_open(), and only PWM_init() function is called.

    That is before calling PWM_open() function is it possible to execute PWMGenPeriodSet and PWMPulseWidthSet APIs.?.

    During PWM_init() time itself is it possible to set the PWM period and and Duty cycle.?.

    Regards

    Nikhil

  • Nikhil KV1 said:
    Without calling PWM_open(), and only PWM_init() function is called.

    Are those 2 functions resident w/in vendor's standard API?    If 'energia' - directing such question 'to that source' proves best.

    Kindly note - NO mention of  (the assumed) 'energia' appeared earlier - nor does it arrive (even) now.

    You may 'tease out' such answers via careful & controlled experimentation.    Be sure to disconnect any/all Motors or other 'loads' - which 'had' earlier attached to your PWM and/or connected Power Stage.   

    A current-limited LED proves an effective  'PWM Monitor.'     You may then, 'Step thru your code' - while observing the Led - thus enabling you to, 'Note the impact of individual function calls' - in a 'SAFE & CONTROLLED Manner!'

  • Hi Nikhil,

      You are asking a TI-RTOS question that you didn't clarify in the beginning of your post. The PWM_Params_init() initializes an PWM_Params data structure while the PWM_open() initializes a given PWM instance (i.e. PWM0, PWM1 or etc). So to answer your question, without calling the PWM_open() on the specified PWM instance, you cannot have the effect of the period/duty on that instance.