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.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I am trying to figure out how PwmOut works on the LPC11U24
#include "mbed.h" PwmOut hr(p6); int prd = 1000; // 1000 milli seconds or 1 second int pw = 500; // 500 milli seconds or .5 seconds or 50% duty cycle int main() { hr.period_ms(prd); while (1) { hr.pulsewidth_ms(pw); } }I am assuming that I would see a 1 second period with a .5 second pulse.
What I see on my oscilloscope is a waveform that has a period of 31.6ms and a pulse width of 10ms.
Also if i run the code below I get no waveform only a 2.7 volt DC
#include "mbed.h" PwmOut hr(p6); int prd = 1000; // 1000 milli seconds or 1 second int pw = 500; // 500 milli seconds or .5 seconds or 50% duty cycle int main() { hr.period_ms(prd); hr.pulsewidth_ms(pw); while (1) { } }What am I doing wrong.
Thanks Bill