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.

Yoel's Content

There have been 3 items by Yoel (Search limited from 12-December 18)


By content type

See this member's

Sort by                Order  

#42006 PWM - Netduino Plus 2 problem

Posted by Yoel on 21 December 2012 - 09:24 AM in Netduino Plus 2 (and Netduino Plus 1)

If I understand correct the period include the both part (High and low) and duty cycle is (high time)/(period time). I measure the time between rising edges to get the period.



#42002 PWM - Netduino Plus 2 problem

Posted by Yoel on 21 December 2012 - 08:27 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for your answer. I try this way too, but if I wrote 500 Hz I expect to get period of 2000us but instead I got 1000us... The duty Cycle work correct.



#41980 PWM - Netduino Plus 2 problem

Posted by Yoel on 20 December 2012 - 10:07 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,
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);
            M1P.Start();

            while (true)
            {
                Thread.Sleep(1000);
                led.Write(true);
                Thread.Sleep(1000);
                led.Write(false);
            }

        }

    }
}

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.