10 years ago.

What's wrong with PWM out?

I was going to port the EPD library on Nucleo F030R8 when I encountered problems with PWM output. My program didn't work but instead printed "pinmap not found for peripheral" on the terminal and halted. Then I tried the Nucleo_pwm example program:

#include "mbed.h"

PwmOut mypwm(PWM_OUT);
//PwmOut mypwm(PB_3);
DigitalOut myled(LED1);

int main() {
    mypwm.period_ms(10);
    mypwm.pulsewidth_ms(1);
    printf("pwm set to %.2f %%\n", mypwm.read() * 100);
    while(1) {
        myled = !myled;
        wait(1);
    }
}

and got the excactly same result.

The Nucleo F030R8 documentation on mbed.org lists the PWM_OUT pin and I can find it from also from PinNames.h.

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F030R8T6 microcontroller.

I tried PC_7 instread of PWM_OUT. The code worked and I was able to measure 100Hz from the pin.

posted by Pekka Ahmavuo 06 Apr 2014

2 Answers

10 years ago.

Hello,

The list of the pwm outputs are in the pwmout_api.c file. Today only PA_7, PC_7 and PB_6 pins can output a pwm signal. More pins will be added. Concerning the PWM_OUT label defined in the pinnames.h file, it is an error. We will change it. Thanks for having notice that. Regards.

Accepted Answer
10 years ago.

Any idea as to when there will be support for PB_10 & PB_4?

Hello, We are working on it. It should come soon on GitHub (end of the week). But I don't know when it will be available on mbed.org. Regards.

posted by bco stm 14 Apr 2014