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

Unable to communicate with Netduino Plus 2


  • Please log in to reply
5 replies to this topic

#1 mobilegamer999

mobilegamer999

    Member

  • Members
  • PipPip
  • 12 posts

Posted 15 November 2012 - 02:13 AM

I just got my Netduino Plus 2 today and I was programming it when it no longer program the netduino.
MFDeploy errors when I try to ping it and bringing the RESET pin to 3v3 and power cycling did nothing as it still shows up as a netduino instead of a COM port.
Not sure what to do next to try and get it to work.

If at all helpful the last successful program to it just initialized 2 PWM port but due to a rogue copy and paste they both initialized on the same port. Here is that code that was flashed to it.
PWM p = new PWM(Cpu.PWMChannel.PWM_0, 45.45 / 2, 0.10, false);
p.Start();
PWM p2 = new PWM(Cpu.PWMChannel.PWM_0, 45.45 / 2, 0.18, false);
p2.Start();


#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 November 2012 - 02:59 AM

Hi mobilegamer999, Interesting. That code should throw an exception. We'll have to check a bit deeper into the new PWM classes from NETMF 4.2. Thank you for sharing that. If you've locked yourself out of your Netduino Plus 2, try erasing and reflashing the board. This process is much simpler with Netduino Plus 2 than with Netduino Plus 1. Full re-flashing instructions can be found in the latest Netduino Plus 2 firmware thread: http://forums.netdui...-firmware-v421/ Welcome to the Netduino community, Chris

#3 mobilegamer999

mobilegamer999

    Member

  • Members
  • PipPip
  • 12 posts

Posted 15 November 2012 - 03:07 AM

Hi mobilegamer999,

Interesting. That code should throw an exception. We'll have to check a bit deeper into the new PWM classes from NETMF 4.2. Thank you for sharing that.

If you've locked yourself out of your Netduino Plus 2, try erasing and reflashing the board. This process is much simpler with Netduino Plus 2 than with Netduino Plus 1.

Full re-flashing instructions can be found in the latest Netduino Plus 2 firmware thread:
http://forums.netdui...-firmware-v421/

Welcome to the Netduino community,

Chris


Sweet! Worked like a charm, thank you very much for your quick and helpful support
.

#4 xmakina

xmakina

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 May 2013 - 10:28 AM

Hi,

 

I am having the same problem as this one. 

 

This was made latest code when suddenly it said "There were deployment errors" . Tried to restart the PC, disconnected and reconnected the NDP2, but to no avail.

 

 

namespace AnalogPulseWidthModulation
{
    public class Program
    {
        // setup analog input
        static SecretLabs.NETMF.Hardware.AnalogInput potentiometer = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
        static SecretLabs.NETMF.Hardware.PWM pulseWidthModulatedLed = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D0);
     
        public static void Main()
        {
            potentiometer.SetRange(0, 100); // to make this show value in % 
 
            int potentiometerValue = 0;
 
            while (true)
            {
                // By default, Read() will return 0-1023 by default
                // But here, the range was customized to return values 
                // from 0, 100
                potentiometerValue = potentiometer.Read();
                pulseWidthModulatedLed.SetDutyCycle((uint)potentiometerValue);                
            }
        }
    }
}
 

I tried to re-flash as suggested above. But when I got to "Device Capabilities" it said "Not Supported", I have .NET Microframework SDK 4.3 (RTM) and Netduino SDK v4.2.2.

 

What should I do ? Was there any problem in my code that made the NDP2 stop responding ?

 

Thanks and regards,

 

xMakina



#5 xmakina

xmakina

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 May 2013 - 11:10 AM

UPDATE: 

 

I have already re-flashed. Now I can ping it, and it now responds when I click the "Device Capabilities". Then I encountered this:

 

Error 1 Cannot deploy the base assembly 'mscorlib', or any of his satellite assemblies, to device - USB:Netduino twice. Assembly 'mscorlib' on the device has version 4.3.0.0, while the program is trying to deploy version 4.2.0.0
 

So I changed my project's  target framework to 4.3 and I can now deploy to NDP2 successfully But when the program runs, nothing happens except the on-board LED lights up constantly.(In my program, I don't even have any mention of the on-board led.) Also, VS suddenly exits the debug mode and nothing's happening.

 

Do you think this has something to do with the new firmware ?

 

Pinging... TinyCLR

Pinging... TinyCLR
Pinging... TinyCLR
 
Also, where do I download the firmware files itself , not the source files , as I am not familiar with C++ ? (I assume the .DFU file is the firmware right? )
 
I tried to re-flash again, and the on-board light went off. But when I ran the program again, it lit up again. (Again, In my program, I don't even have any mention of the on-board led.)

 

 

Thanks,

 

xMakina



#6 xmakina

xmakina

    Member

  • Members
  • PipPip
  • 13 posts

Posted 05 May 2013 - 04:06 AM

My program above was wrong. Though, it seems firmware 4.3 beta also have it share of bugs. I tried re-flashing to the older firmware version, 4.2.1, and this corrected code ran perfectly. but when I tried it on firmware v4.3,VS does not even hit the breakpoint, and the debugger just exits suddenly without anything happening.

 

I guess that firmware 4.3 beta is still buggy. Reverting back to firmware v4.2.1....

 

This is the correct one:

 

 

 public class Program
    {
        // setup analog input
     
        static SecretLabs.NETMF.Hardware.AnalogInput potentiometer = new
                   secretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
 
        // use an output port that can handle PWM (pin D5,D6,D9,etc.)
        static PWM pulseWidthModulatedLed = new PWM(PWMChannels.PWM_PIN_D5, 100, 0.5, false); // Set later
     
        public static void Main()
        {
            potentiometer.SetRange(0, 100); // to make this show value in % 
 
            pulseWidthModulatedLed.Frequency = 200;
            pulseWidthModulatedLed.Start();
 
            int potentiometerValue = 0;
            double percent = 0;            
 
            while (true)
            {
                // By default, Read() will return int type from 0-1023 by default
                // But here, the range was customized to return values 
                // from 0, 100
                potentiometerValue = potentiometer.Read();
 
                // divide the read integer value to get the decimal value
                percent = potentiometerValue / 100.0; 
 
                // dutycycle(a double type) needs a value from 0 to 1
                pulseWidthModulatedLed.DutyCycle = percent;
             
            }
        }
    }





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.