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

Setting aside my Shield Base...for now


  • Please log in to reply
14 replies to this topic

#1 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 20 April 2012 - 07:03 PM

It's a sad day, but I think I have to put aside my Shield Base for the time being. It has become frustrating and too quirky to run some of the basic code that worked so happily on my Netduino Plus.

Every deployment of the code ends up with a different result which makes it insanely difficult to debug. In frustration I have to restart my computer numerous times after a debug fails or hangs, then to my surprise the Shield Base lights up with excitement as soon as I plug the USB cable after the restart (heaven forbid keeping it plugged in during reboot). With having to restart so often on my Win 7, 64 bit machine running 4.2 QFE1 and the latest SDK, and as a follicly challenged guy, I just can't justify the all the hair pulling and lost time.

On a good note, the shield base seems very promising and I hope that soon more advanced users will begin to wade through the murky waters of beta testing. I do have all of the Netduino Go modules and the Nwazet display which have been working perfectly. I am having loads of fun creating simple interfaces on the display to turn on/off the rgb led, changing the brightness via the pot, etc, etc. As my first display unit the Nwazet display has been fairly easy to use and a great set of demo code to keep me busy for a while. My relay module shipped today, so I'll be back to annoying my family by turning appliances and off via my Display panel in a short bit. Oh the simple joys!

So, until we get some more Sheild Base early adopters I will be eagerly waiting in the forums for some progress updates and sample code to test.

Regards,
Steve

#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 20 April 2012 - 08:03 PM

Very sad indeed, especially considering one does not give up easily on these things. I trust you've made sure that there's nothing wrong with the particular instance of Shield Base you've been using?

#3 EricMeyer

EricMeyer

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAllen, Texas

Posted 20 April 2012 - 08:18 PM

Posted Image ouch ... not happy to hear that. I was planning to play around with mine this weekend ... looks like I'll take a wait and see. I have enough stress in my life and my hobby is supposed to relax me not stress me out.

-Eric

#4 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 20 April 2012 - 08:42 PM

Hanzibal, it could very well be something wrong with my board or possibly even with my particular dev environment. I don't have the tools to really check the hardware, and unfortunately there aren't enough code samples and other testers to compare notes. And to be honest my Netduino Go shield base has been hard to quit cold turkey. I liken it to crack for an addict. In a perfect world it would be nice to have two Shields to compare but the budget doesn't allow for it just yet. Eric, I would highly encourage you to give it a shot and try some code as I do know the are a few people that have had little to no trouble. By no means should you take my "venting" as any indication of how your experiences may turn out. Rather I would highly encourage you to test away and report back here on the forum so that we can compare notes. In fact I implore you to do so. Steve

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 April 2012 - 09:15 PM

Hi Gutworks, Is there any specific code which is giving you trouble with the Shield Base? Is it related to using PWM? If you run a "blinky" sample with it, does that work consistently? We are working on the first update to the Shield Base firmware...and we want to catch any issues that are out there. It seems to be working solidly for most users, and we want to get it working for you too :) Finally...can you please try the new Netduino v4.2.0 SDK that was posted early this morning? It includes the new 4.2 MFUSB drivers. Thanks, Gutworks! Chris P.S. We do test each mainboard and module before it ships, but if there's an issue with your board...we'll of course be happy to replace it!

#6 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 20 April 2012 - 09:36 PM

Thanks Chris. I have now tried most of code from your Getting Started with Netduino and the Experimenter's Kit, and the results have been varying. Most of the time it was issues surrounding PWM, and any project using the Digital pins. Examples using the AnalogInput pins seem to work ok. I will consolidate my code samples and post some results. I am using the new SDK from this morning. I was excited to try it first thing this morning, and spent the entire day trying out various samples. Been diligently testing the shield for the better part of this week and last, but the results are so varied it has been difficult to tell when it's a code or driver issues. I still do get BSOD's if I unplug while the debugger hangs, however it is much less frequent than before. As for the Blinky example, it was my last test, and no it didn't work consistently. At times it would throw errors, and other times it would compile. Later this evening I'll try and get some screenshots and create some testing scenarios. Steve

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 April 2012 - 09:40 PM

As for the Blinky example, it was my last test, and no it didn't work consistently. At times it would throw errors, and other times it would compile. Later this evening I'll try and get some screenshots and create some testing scenarios.

Thank you very much. We left the NetduinoGo.ShieldBase.dll out of the SDK since it's beta...but this also means that it's much easier to update for beta purposes :)

Chris

#8 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 20 April 2012 - 10:13 PM

For this example I have created new project and have created a simple Blinky test with the code sample below. As you can see when I run it I get the following error "An unhandled exception of type 'System.Exception' occurred in NetduinoGo.ShieldBase.dll".

I am using the SDK from this morning, 4.2 QFE1, and am running Win7. The Shield Base is attached to socket 1 and there are no other modules attached.

Perhaps I have an ID 10 T issue? :)

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoGo;

namespace NetduinoGo_ShieldBaseBlinky
{
    public class Program
    {
        static NetduinoGo.ShieldBase shieldBase = new NetduinoGo.ShieldBase(GoSockets.Socket8);
        static OutputPort led = new OutputPort(shieldBase.Pins.GPIO_PIN_D2, false);
        public static void Main()
        {
            while (true)
            {
                led.Write(true);
                Thread.Sleep(1000);
                led.Write(false);
                Thread.Sleep(1000);

            }


        }

    }
}

Attached File  blinky.gif   84.28KB   27 downloads

#9 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 20 April 2012 - 10:46 PM

Here is another simple Servo example. I started a fresh project, using the new SDK. I have also added a LED using the Analog pin instead of the digital pin as in the previous example. I have also added the reference to Microsoft.SPOT.Hardware.PWM 4.2.0.1.

The very first time I try this example, after a computer reboot, the servo continually rotates and stops at the end of the code. The LED also flashes for every iteration. However, the servo does not rotate back to a beginning position as expected.

The really odd behaviour is that if I stop the debugger, and try again, the servo has a bit of a spike, and then stops, but the LED does continually flash. No matter how many times I retry, the servo will not rotate, unless I restart my computer. After the restart, I can plug the Go! back into the USB port, and the flashed code sample will run, and the servo will rotate completely.

using System;                               //use base classes                            
using System.Threading;                     //use threading classes        
using Microsoft.SPOT;                       //use smart personal objects technology classes
using Microsoft.SPOT.Hardware;              //use hardware related SPOT classes
using SecretLabs.NETMF.Hardware.NetduinoGo;


namespace NGo_ShieldBaseLEDandServo
{
    public class Program
    {
        public static void Main()
        {
            NetduinoGo.ShieldBase shieldBase = new NetduinoGo.ShieldBase(GoSockets.Socket1);

            Microsoft.SPOT.Hardware.OutputPort led = new Microsoft.SPOT.Hardware.OutputPort(shieldBase.Pins.GPIO_PIN_A5, false);
            Microsoft.SPOT.Hardware.PWM servo = new Microsoft.SPOT.Hardware.PWM(shieldBase.PWMChannels.PWM_3, 20000, 1500, Microsoft.SPOT.Hardware.PWM.ScaleFactor.Microseconds, false);

            led.Write(false); //Turn LED off
            uint firstPosition = 1000; //Minimum pulse width of 1ms
            uint lastPosition = 2000;  //Maximum pulse width of 2ms

            // move through the full range of positions
            for (uint currentPosition = firstPosition;
                 currentPosition <= lastPosition;
                 currentPosition += 10)
            {
                Debug.Print("currentPosition: " + currentPosition);
                // move the servo to the new position.
                servo.Duration = currentPosition; //Set Duration to the last known value from 1ms to 2ms
                servo.Period = 20000; //Set Period to 20ms
                servo.Start();
                led.Write(!led.Read()); //Flash the LED on every position change
                Thread.Sleep(20); //refresh the pulse every 20 milliseconds
            }

            servo.Duration = firstPosition; // return to first position
            servo.Period = 20000;
            servo.Start();
            Debug.Print("firstPosition: " + firstPosition);
            led.Write(false); //turn LED off
            servo.Stop();
            Thread.Sleep(Timeout.Infinite);

        }

    }
}


#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 April 2012 - 10:51 PM

Hi Gutworks,

For this example I have created new project and have created a simple Blinky test with the code sample below. As you can see when I run it I get the following error "An unhandled exception of type 'System.Exception' occurred in NetduinoGo.ShieldBase.dll".

I am using the SDK from this morning, 4.2 QFE1, and am running Win7. The Shield Base is attached to socket 1 and there are no other modules attached.

        static NetduinoGo.ShieldBase shieldBase = new NetduinoGo.ShieldBase(GoSockets.Socket8);

Okay, that's guaranteed not to work :) Can you change the Shield Base to socket 8 -- or change "GoSockets.Socket8" to "GoSockets.Socket1" in your code?

Chris

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 April 2012 - 10:53 PM

The really odd behaviour is that if I stop the debugger, and try again, the servo has a bit of a spike, and then stops, but the LED does continually flash. No matter how many times I retry, the servo will not rotate, unless I restart my computer. After the restart, I can plug the Go! back into the USB port, and the flashed code sample will run, and the servo will rotate completely.

Okay, it's possible that there's a glitch in the PWM implementation. Let me wire up a servo and test this out here. [Stefan -- did you also test this?]

It sounds like the OutputPort feature is working then...but PWM is giving you intermittent results?

Chris

#12 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 21 April 2012 - 01:52 AM

Hi Gutworks,

Okay, that's guaranteed not to work :) Can you change the Shield Base to socket 8 -- or change "GoSockets.Socket8" to "GoSockets.Socket1" in your code?

Chris

Go, on you can say it. I know it must have been killing you not to say it. I would have called it an ID 10 T error :)

So I changed my the Socket to Socket1 (still can't believe I did that), but I still get the same error. :(

Attached Files



#13 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 April 2012 - 02:48 AM

Hi Gutworks,

Go, on you can say it. I know it must have been killing you not to say it. I would have called it an ID 10 T error :)

So I changed my the Socket to Socket1 (still can't believe I did that), but I still get the same error. :(

Just trying to help get you up and running :)

Can you try moving the object creation inside your Main function? It's possible that NETMF is creating dependent objects out of order by creating these at the static class level...

Chris

#14 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 21 April 2012 - 03:29 AM

Hi Gutworks,


Just trying to help get you up and running :)

Can you try moving the object creation inside your Main function? It's possible that NETMF is creating dependent objects out of order by creating these at the static class level...

Chris

Brilliant. That seemed to do the trick. I now have a blinky LED!

I was trying to set the duty cycle of the led a few moments ago but I don't fully understand the new constructor - not sure what frequency to use.
PWM led2 = new PWM(shieldBase.PWMChannels.PWM_3, 50, 100, false);
After the initialization I tried to Start() the led, but that didn't work alone. Then I tried to set the Duty and Frequency separate but that also didn't have any effect. I also tried 10hz for the freq, but that was just a shot in the dark. Anyway, this is progress, and I love progress. Thanks for the help!

#15 EricMeyer

EricMeyer

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAllen, Texas

Posted 22 April 2012 - 01:23 AM

My few experiments have also been successful on the shield base. Nothing fancy, just used a expansion shield from GHI along with several LEDs nothing fancy just a traffic light simulation. Everything worked great. -Eric




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.