7 years ago.

Generating PWM on any pin?!

Hi,

I can't generate PWM on any PWM enabled pin on ST NUCLEO 334R8. The program hangs if I delcare a PwmOut on any pwm enabled pin. I tried PA_8, PA_9, PB_4, PB_5, PC_2 ...) I'm compiling offline with Keil MDK 5, and trying to debug, but without any reasonable results. What am I doing wrong?

Question relating to:

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

Posting a small program that shows the problem would probably help. Are you watching the debug messages over the mbed interface? If something like this fails, there is usually an error message. Or if you set a breakpoint inside the PWM constructor you might be able to step through and see why it fails.

posted by Graham S. 03 Apr 2017

AnalogIn						NTC_signal(PC_0);			// Analogni vhod za NTC peltier
AnalogIn						PELT_sns1(PB_0);			// 24V input
AnalogIn						PELT_sns0(PA_2);			// Vout iz regulatorja
BusOut							LEDS(PB_8, PB_9, PC_13, PC_14, PC_15); //Bus za ledice

DigitalOut					PELT_disable(PC_9);
DigitalIn						PELT_thshdn(PC_12);
PwmOut							PELT_pwm(PA_8); // <<< The program hangs right here

The program hangs right there, where I declare PwmOut, on any pin. I actually tried allmost all pins (PWM related), and I allways get the runtime error. I don't get any error feedback on uart.

posted by Gorazd Rosbach 04 Apr 2017
Be the first to answer this question.