I must be brain dead... I can not seem to get PWM working on either the 303RE or 303K8 nucleo boards.
In both cases I copied the demo project, confirmed that the tests worked and then copied what I believe is the minimal amount of code from the PWM testhal projects.
Here is the two areas of code I copied,
static PWMConfig pwmcfg = {
100000, /* 10kHz PWM clock frequency. */
5000, /* Initial PWM period ??. */
NULL,
{
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_DISABLED, NULL}
},
0,
0
};and
palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATE(2));
pwmStart(&PWMD3, &pwmcfg);
pwmEnableChannel(&PWMD3, 3, PWM_PERCENTAGE_TO_WIDTH(&PWMD3, 1000));
I've verified that I am using the proper pins for the timer/channel. I've changed freq, period, duty cycle, timer and channel.
I just get nothing out.
What am I forgetting?
Thanks