Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino 2+ crashes with PWM only

PWM

  • Please log in to reply
5 replies to this topic

#1 JeffJohnson

JeffJohnson

    Member

  • Members
  • PipPip
  • 15 posts

Posted 27 December 2012 - 09:16 PM

Hi all,

 

I've had no luck getting this to deploy on this machine.  My Win 7 machine ran ok.  This is XP SP3 laptop.  Please have a look and try it on your device.

 

Thanks for helping!

 

Jeff



#2 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 27 December 2012 - 09:59 PM

Unfortunately it doesn't seem like your attachment worked. Can you try reattaching your project folder zip? If I get a chance later this evening I'll try it out.    Cheers, Steve

#3 JeffJohnson

JeffJohnson

    Member

  • Members
  • PipPip
  • 15 posts

Posted 27 December 2012 - 10:21 PM

I think it pukes if you put a 0 in the PWM declaration/initialization.  This one line of code crashes: PWM ch1 = new PWM(PWMChannels.PWM_PIN_D9, 1000, 0, false);     But this works:  
// This code crashes when it tries to launch debuggerPWM ch1 = new PWM(PWMChannels.PWM_PIN_D9, 1000, .2, false);ch1.DutyCycle = .5;ch1.Start();while (true){for (double i = 0; i < .75; i += .05){ch1.DutyCycle = i;Thread.Sleep(400);}for (double j = 1; j > 0; j -= .05){ch1.DutyCycle = j;Thread.Sleep(400);}}


#4 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 27 December 2012 - 10:23 PM

I just tried the code you posted in Pastebin earlier today (http://pastebin.com/7jrMkxE0) and I was able to deploy it several times without any issues. I wonder if you have the latest firmware, Netduino SDK and .Net Micro Framework installed. The latest Netduino Plus 2 firmware is dependent on .NET Micro Framework v4.2 SDK (QFE2) and Netduino 4.2.1.0 SDK.

 

Steve



#5 JeffJohnson

JeffJohnson

    Member

  • Members
  • PipPip
  • 15 posts

Posted 29 December 2012 - 09:27 PM

I just tried the code you posted in Pastebin earlier today (http://pastebin.com/7jrMkxE0) and I was able to deploy it several times without any issues. I wonder if you have the latest firmware, Netduino SDK and .Net Micro Framework installed. The latest Netduino Plus 2 firmware is dependent on .NET Micro Framework v4.2 SDK (QFE2) and Netduino 4.2.1.0 SDK.

 

Steve

I do have NMF 4.2 and Netduino 4.2.1 (November 2012).  The program now runs fine as long as I don't put "0" for the duty cycle initially.  Hmm.  Thanks for the reply though.



#6 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 29 December 2012 - 10:42 PM

PWM ch1 = new PWM(PWMChannels.PWM_PIN_D9, 1000, .2, false);

ch1.DutyCycle = .5;

ch1.Start();

 

you could just set it to 0.5f in constructor

 

PWM ch1 = new PWM(PWMChannels.PWM_PIN_D9, 1000, 0.5f, false);

ch1.Start();

 

i know thats not the problem/question, still had to mention it :P







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.