Doubt about PWMConfig Structure.

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

sapan
Posts: 56
Joined: Sat Dec 24, 2011 1:22 pm

Re: Doubt about PWMConfig Structure.

Post by sapan »

I have defined STM32_PWM_USE_TIM8 as TRUE in mcuconf.h
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Doubt about PWMConfig Structure.

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Doubt about PWMConfig Structure.

Post 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
sapan
Posts: 56
Joined: Sat Dec 24, 2011 1:22 pm

Re: Doubt about PWMConfig Structure.

Post 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....:)
Post Reply