Page 2 of 2

Re: Doubt about PWMConfig Structure.

Posted: Mon Mar 12, 2012 8:28 am
by sapan
I have defined STM32_PWM_USE_TIM8 as TRUE in mcuconf.h

Re: Doubt about PWMConfig Structure.

Posted: Mon Mar 12, 2012 8:45 am
by Giovanni
Post your pins setup code, anyway PB14 and PB15 are not used for PWM8 outputs but for PWM8 negated outputs, I am not sure if the current driver supports negated outputs, I have to verify. You may use PC6...PC9 instead.

Giovanni

Re: Doubt about PWMConfig Structure.

Posted: Mon Mar 12, 2012 8:57 am
by Giovanni
OK, verified.

It supports complementary outputs but you have to enable STM32_PWM_USE_ADVANCED which enables another field in the configuration structure, put it to zero.

The complementary outputs behavior is defined by PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH or PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW.

Giovanni

Re: Doubt about PWMConfig Structure.

Posted: Mon Mar 12, 2012 9:57 am
by sapan
Got it...changed the setting and its working now...Thanks for help.

I have enabled STM32_PWM_USE_ADVANCED in mcuconf.h and changed config as follow...

Code: Select all

/*pwmcfg8 - to be used for PWM8..i.e timer 8 */
static PWMConfig pwmcfg8 = {
  1000000,                                    /* 1MHz PWM clock frequency.   */
  20000,                                    /* 20 ms time period*/

  NULL,
  {                                 /*CH2N and CH3N of Timer 8 are available for PWM. Enable those */
                                                                  /*   disable rest*/
    {PWM_OUTPUT_DISABLED, NULL},
    {PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH, NULL},
    {PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH, NULL},
    {PWM_OUTPUT_DISABLED, NULL}
  },
  /* HW dependent part.*/
  0,
  0   /* STM32_PWM_USE_ADVANCED is enabled which adds additional field*/
};



Now its working fine and giving output pwm as expected. Thanks....:)