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.

daGuy

Member Since 01 Mar 2011
Offline Last Active Sep 24 2014 06:57 PM
-----

Posts I've Made

In Topic: PWM freezes Netduino in 4.2.0.1 Firmware

30 October 2012 - 10:05 PM

I haven't experienced any issues like this with the latest firmware. Can you post a simple code sample and I will try to reproduce it?

Steve



I actually wrote a new code fragment to test it out and it seems to be working now. I am using this piece:

public class Program
{
	public static void Main()
	{
		PWM pwm = new PWM(PWMChannels.PWM_PIN_D5, 1000, 500, PWM.ScaleFactor.Microseconds, false);

		OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
		Boolean ledState = false;
		while (true)
		{
			led.Write(ledState);
			ledState ^= true;
			Thread.Sleep(500);
		}
	}
}

In retrospect I think I made two mistakes:

1. I used the wrong pin. Wanted to use D5 but started with Cpu.PWMChannel.PWM_5 which Intellisense suggests so very helpfully. I still find it confusing that instead I have to use the wrappers (PWMChannels.PWM_PIN_D5, also for the normal pins)
2. I set the ScaleFactor to Milliseconds and used the values above for period and duration.

So, sorry for the smoke, it seems to work now!

Thank you so much,
Jens

In Topic: Netduino 1 Firmware v4.2.0 (update 1)

28 October 2012 - 07:36 PM

Hi, I just updated to this version (4.2.0.1) following all the steps and the Netduino works perfectly...until I try to use the PWM classes. Whenever I create a pwm output the whole Netduino freezes and is not recognized by windows anymore. I have to do a complete erase and flash the firmware again to revive it. Am I missing something important or is there a bug that nobody else seems to have seen so far? Googling didn't bring up any answers for me. Thanks for your help! Jens

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.