MCU Stopped Working after 3 minutes

25 Oct 2010

Hello Everyone,

I'm new to Mbed and I need some anwer to why my MCU stop running after 3 minutes.

My code is very simple, just blink an led with PwmOut at 38khz.  I suspect that it might have to do something with the watchdog timer.

Here is my code:

#include "mbed.h"

PwmOut  irEmitter(p21);

int main() {
irEmitter.period_us(.50);
irEmitter.pulsewidth_us(0.250);

while(1) {
//do nothing     
}
}

 

Thanks in advance.

 

<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Garamond; panose-1:2 2 4 4 3 3 1 1 8 3; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:647 0 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; mso-bidi-font-size:10.0pt; font-family:"Garamond","serif"; mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:"Times New Roman";} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} -->

25 Oct 2010

period_us() and pulsewidth_us() accept integers as their arguments and you have supplied a floating point value.

25 Oct 2010

Thanks Andy.

my bad. Should have read the code more careful next time.