Doubt about PWMConfig Structure.
Moderators: RoccoMarco, lbednarz, tfAteba
- 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 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
Giovanni
- 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.
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
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.
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...
Now its working fine and giving output pwm as expected. Thanks....
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....