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

We snuck a GoBus 2.0 feature into the latest firmware...


  • Please log in to reply
16 replies to this topic

#1 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2013 - 10:51 AM

Dear friends, We snuck one of the really cool new features of GoBus 2.0 into the latest Netduino Go firmware. In summary, Netduino Go now maps traditional Netduino projects' I/O to the Shield Base automatically. What does this mean? Let's take the classic "blinky" sample for instance. If you run the following code on your freshly-updated Netduino Go (using updated ShieldBase firmware and driver dll), it will actually blink the blue LED mapped to the Shield Base's GoPort.
NetduinoGo.ShieldBase shieldBase = new NetduinoGo.ShieldBase((GoBus.GoSocket)5);OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);while (true){    led.Write(!led.Read());    Thread.Sleep(100);}
Note that we used Pins.ONBOARD_LED and not shieldBase.Pins.ONBOARD_LED. GoBus automatically mapped the standard Pins collection to the first Shield Base it knew about. This is made possible by the new standardized Netduino HardwareProvider which is also used on Netduino and Netduino Plus 2. Basically, any time you try to use a Pin or AnalogChannel or PwmChannel of a Netduino--but deploy the code to a Netduino Go instead--you'll get the corresponding I/O feature on your Shield Base! This also extends to SPI channels (when using the SPI_Devices collection). We will be extending this to also auto-map SerialPorts in a future release...but for now use the shieldBase.SerialPorts collection for serial ports. Finally, you don't technically need to create a ShieldBase object. For now, if you want to play with this feature, I highly recommend creating one (as done above) to specify the Shield Base's physical connection. But if you leave that line out...your Netduino Go will automatically find the Shield Base. It is using the GoBus UART transport--so the auto-detect is about 100 times slower than it will be with GoBus 2.0 (5-10 seconds instead of 50-100 milliseconds), but the architecture is now baked in.  
OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);while (true){    led.Write(!led.Read());    Thread.Sleep(100);}
Of course, the I/O auto-mapping works with all the analog and digital pins on Shield Base. So Pins.GPIO_PIN_D5, PwmChannels.PWM_PINS_D9, etc. all map automatically and seamlessly. You can even use the recently-updated legacy SecretLabs AnalogInput and PWM classes with auto-mapped virtual I/O. With the newest Netduino Go firmware, the new USB name is now simply "Netduino" instead of "NetduinoGo". As we go forward, this will enable you to simply deploy existing Netduino applications (including Netduino Plus/Plus 2 apps) to your Netduino Go unchanged. Then you can simply add GoBus modules to the project, to take advantage of the best of both worlds. Enjoy, and thank you for all your feedback. Chris

#2 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 13 January 2013 - 12:35 PM

I don't have a go, but its good to see you working on these sorts of features to streamline everything.

Well done.



#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 13 January 2013 - 01:45 PM

Managed to get the Blinky example working after some jiggery pokery with the project references :)

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 13 January 2013 - 07:33 PM

Dear friends, We snuck one of the really cool new features of GoBus 2.0 into the latest Netduino Go firmware. In summary, Netduino Go now maps traditional Netduino projects' I/O to the Shield Base automatically. What does this mean? Let's take the classic "blinky" sample for instance. If you run the following code on your freshly-updated Netduino Go (using updated ShieldBase firmware and driver dll), it will actually blink the blue LED mapped to the Shield Base's GoPort.

NetduinoGo.ShieldBase shieldBase = new NetduinoGo.ShieldBase((GoBus.GoSocket)5);OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);while (true){    led.Write(!led.Read());    Thread.Sleep(100);}
Note that we used Pins.ONBOARD_LED and not shieldBase.Pins.ONBOARD_LED. GoBus automatically mapped the standard Pins collection to the first Shield Base it knew about. This is made possible by the new standardized Netduino HardwareProvider which is also used on Netduino and Netduino Plus 2. Basically, any time you try to use a Pin or AnalogChannel or PwmChannel of a Netduino--but deploy the code to a Netduino Go instead--you'll get the corresponding I/O feature on your Shield Base! This also extends to SPI channels (when using the SPI_Devices collection). We will be extending this to also auto-map SerialPorts in a future release...but for now use the shieldBase.SerialPorts collection for serial ports. Finally, you don't technically need to create a ShieldBase object. For now, if you want to play with this feature, I highly recommend creating one (as done above) to specify the Shield Base's physical connection. But if you leave that line out...your Netduino Go will automatically find the Shield Base. It is using the GoBus UART transport--so the auto-detect is about 100 times slower than it will be with GoBus 2.0 (5-10 seconds instead of 50-100 milliseconds), but the architecture is now baked in.  
OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);while (true){    led.Write(!led.Read());    Thread.Sleep(100);}
Of course, the I/O auto-mapping works with all the analog and digital pins on Shield Base. So Pins.GPIO_PIN_D5, PwmChannels.PWM_PINS_D9, etc. all map automatically and seamlessly. You can even use the recently-updated legacy SecretLabs AnalogInput and PWM classes with auto-mapped virtual I/O. With the newest Netduino Go firmware, the new USB name is now simply "Netduino" instead of "NetduinoGo". As we go forward, this will enable you to simply deploy existing Netduino applications (including Netduino Plus/Plus 2 apps) to your Netduino Go unchanged. Then you can simply add GoBus modules to the project, to take advantage of the best of both worlds. Enjoy, and thank you for all your feedback. Chris

 

How will this work after the ShieldBase beta, when I might have 8 ShieldBases connected?  Will it always choose the first one, or will I get an AmbiguousReferenceException?

 

I suspect that I'll have to be explicit and select which SB I want the use my Pin on.


When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2013 - 09:19 PM

Hi Arron,
How will this work after the ShieldBase beta, when I might have 8 ShieldBases connected?  Will it always choose the first one, or will I get an AmbiguousReferenceException?   I suspect that I'll have to be explicit and select which SB I want the use my Pin on.
Great question. It will use the first Shield Base it knows about. If you've already instantiated one in code, it will use the first one you instantiated. If you have not instantiated any, it will search the bus until it finds one. The goal is to make simple projects work exactly the same on "Netduino Go + Shield Base" as they would on the other Netduinos. Full code compatibility is the direction we're heading. If you want to use multiple Shield Bases once the Shield Base firmware goes gold, you can address all of their I/O features using the ShieldBase.Pins, ShieldBase.AnalogChannels, etc. collections. Chris

#6 Frickr

Frickr

    New Member

  • Members
  • Pip
  • 6 posts

Posted 14 January 2013 - 01:18 AM

Managed to get the Blinky example working after some jiggery pokery with the project references :)

 

Regards,

Mark

what references did you need to change to get this working? i added the new sheildbase.dll and i dont see the ONBOARD_LED.



#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 January 2013 - 01:47 AM

Hi Frickr,
what references did you need to change to get this working? i added the new sheildbase.dll and i dont see the ONBOARD_LED.
If you replace the SecretLabs.NETMF.Hardware.NetduinoGo.dll assembly with the standard SecretLabs.NETMF.Hardware.Netduino.dll assembly, they'll show up. The 4.2.2 SDK comes with an updated NetduinoGo assembly which contains these as well. Chris

#8 Frickr

Frickr

    New Member

  • Members
  • Pip
  • 6 posts

Posted 14 January 2013 - 02:58 AM

ok thank you works great now!



#9 Gerald

Gerald

    New Member

  • Members
  • Pip
  • 4 posts
  • LocationBoston, MA

Posted 14 January 2013 - 06:35 PM

I just bought a boatload of Netduino go stuff, but it's go us 1.5. Does go us 2.0 require different hardware?Thanks and pardon my ignorance on this topic.Gerry

#10 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 14 January 2013 - 06:40 PM

I just bought a boatload of Netduino go stuff, but it's go us 1.5. Does go us 2.0 require different hardware? Thanks and pardon my ignorance on this topic. Gerry

Hi Gerald and welcome to the community!

 

Everything will be forwards and backwards compatible so no need to worry :)

 

What did you get and what projects are you planning with your new Netduino Go? 

 

Cheers,

Steve



#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 January 2013 - 06:58 PM

I just bought a boatload of Netduino go stuff, but it's go us 1.5. Does go us 2.0 require different hardware? Thanks and pardon my ignorance on this topic. Gerry
As Gutworks mentioned, Netduino Go will get a firmware update to work with GoBus 2.0 devices (hubs, the new auto-map Shield Base I/O, etc.). Chris

#12 Gerald

Gerald

    New Member

  • Members
  • Pip
  • 4 posts
  • LocationBoston, MA

Posted 14 January 2013 - 10:02 PM

Thanks for your answers Steve & Chris.

 

 

I agonized for weeks over whether to get the Plus 2 or the GO. I ended up going with the GO hoping that I could eventually buy an ethernet module and SD module for it. I already got the Power module from NWazet. To be honest, I came an inch away from buying them both, but because I don't understand everything yet, it wasn't clear how to interface the Plus 2 with a GoBus. Perhaps you guys could make a GoBus adapter for the Plus 2? Probably best not to suggest stuff like that without understanding how stuff works. Anyhow, I do think I've figured out the GoBus now and it's brilliant. I looked at the .NET Gadgeteer hydra and spider, and they had a lot of bus ports, but i finally realized they were dedicated to only a single or very few protocols each. The GoBus is great because every port supports every protocol. It's also great that it works out of the box with a lot of gadgeteer modules.So nice work. I hope to make my own GO Module someday. Perhaps something simple like a 10 or 20 segment led strip.

 

I bought the following:

Netduino Go! Starter Kit

Nwazet Touch Display

Nwazet Power Module

Nwazet acrylic mounting board

Komodex 7 segment display

Several 20 segment led displays

MAX7219CNG LED driver

 

As for projects, I don't have anything specific planned yet. I'm just trying to get an understanding of what's possible, how things work, and well, have some fun tinkering.

 

I've heard some people bemoan the lack of in-box documentation. Is there a single place online where I can go to figure out how to get started? I know the .NET framework very well, but is there .NET MF book or something that's publicly available? I already bought the Getting Started with Netduino book and it was helpful, but brief.

 

Anyhow, really excited to be part of such a vibrant community of Makers!

 

Gerry



#13 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 14 January 2013 - 11:29 PM

This is awesome! Blinky works a treat!

 

Now when did you say multiple shield bases can be used? :D

 

Maybe a bit of 1-wire too? :P

 

In terms of addressing them if you had say 8, would you instantiate them individually addressing each one by a Go! port in order to control them individually?

 

Also any plans for doing discount packs of shield bases?

 

Any news on any data storage for Go! and maybe a wifi module?

 

I had another thought the other day, how cool would a usb to go! bus adapter be so you could plug in standard Netduino's or Netduino Plus 1 or 2? I guess it would be possible right as you have an extra UART on the USB? Plus this would mean you could benefit from all the network and data stuff on the plus? Perhaps even write some firmware for the plus that could make it act a bit like a shield base?

 

Andy



#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 January 2013 - 11:45 PM

Hi Andy, Lots of good ideas there :) We have more GoBus suprises later this year, so I'm pretty sure we can make at least some of those come true. Also...yes, there are discounts available on Shield Bases. 10% off 10-99, 20% off 100+ at Amazon. And one of our other big resellers will be stocking Shield Bases (with available discounts) soon as well. If you're addressing multiple shield bases (once Shield Base comes out of beta), you simply create an object for each one...and then reference their I/Os through that object. GoBus 2.0 is going to let you put them on hubs too. Chris

#15 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 15 January 2013 - 07:11 PM

Cool!

 

Can you communicate with (and power) a nedduino via its usb, but perhaps the 2 data pins going to rx and tx on another netduino?

 

Many thanks,

 

Andy



#16 Jack Chidley

Jack Chidley

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 25 March 2013 - 05:11 PM

Just tried this on my newly flashed Go/Sheidbase.  Worked perfectly. 

 

Pre debug I was thinking: "there is no on-board-LED". 

Post debug: "Ah, on-board LED = Go's board's socket LED, that makes sense."



#17 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 March 2013 - 06:51 PM

Post debug: "Ah, on-board LED = Go's board's socket LED, that makes sense."

We're tricky that way :) Chris




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.