Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 7 months ago.
PwmOut can not be initialized
I am pretty new to mbed platform, how can i initiliaze PWM on my STK3800? I can't not do with the default code examples
my code looks like this:
pwm try
#include "mbed.h" PwmOut pwm(PA12); int main() { pwm.period_ms(20.0f); pwm.pulsewidth_ms(10.0f); while(1); }
I do not receive compile errors. I cant read pwm output from pin PA12.
Question relating to:
1 Answer
9 years, 7 months ago.
Hi Cagatay,
there is currently a bug in PwmOut for Silicon Labs targets that prevents it from functioning. This bug has already been fixed, and the fix should propagate to mbed-src by tomorrow.
Expect it to show up in mbed proper by the next release, which is due next week Tuesday.
Kind regards, Steven Cooreman
Please use code tags when posting code! You may get a better quality answer if you post all your code. Tell us what errors you are getting.
posted by David Fletcher 20 May 2015I cannot help you any further, as i don't have this board, as a bit of help your program looks fine. I checked the schematics for the correct pin, i noticed that all 3 pwm pins are connected to the LCD not sure if that's a clue. May be some one else can help. Good Luck.
posted by David Fletcher 20 May 2015Yes I saw it too ( three pwm pins are connected to LCD ), thank you for your help :)
posted by Cagatay Sari 20 May 2015