Netduino home hardware projects downloads community

Jump to content

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


Member Since 13 Mar 2011
Offline Last Active Private

Topics I've Started

PWM - Netduino Plus 2 problem

20 December 2012 - 10:07 PM

I have netduino plus 2 with Firmware v4.2.1 (Update 2) and found two problem with pwm:

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace NetduinoApplication1
    public class Program
        public static void Main()
            // write your code here
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);

            PWM M1P = new PWM(PWMChannels.PWM_PIN_D9, 2000, 1000,PWM.ScaleFactor.Microseconds, false);

            while (true)



1. I try to get PWM with period of 2000 us and duty cycle of 50%, but get 1000us with 50% duty cycle. So, I check diffrent values and I always get half of them (period and duration).
2. I also notice when I wrote program with PWM on pin X and upload it to the microcontroller and then I upload another program that doesn't use the pin X, I still get the last PWM configuration on pin X. (With OutputPort the pins return to the default value)

I don't have scope or logic analyzer and I checked the output with another microcontroller (mbed). (I also check
with mbed PwmOut to verify that the problem is with netduino and not with my check tool). Next week I will test it with a real scope :).

am I doing something wrong?

I'm new to netduino so I hope I don't make a stupid mistake...
Sorry for my english....

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.