Hardware Details: Shield Base
#1
Posted 06 April 2012 - 11:11 PM
Arduino "Rev. C" headers
Arduino is working on a new ARM-based board called Arduino Due. Its MCU's pins are not 5V tolerant, and its I2C pins are not in the same place as the AVR-based Arduino Uno.
So late last year, Arduino released a new "Rev C" line of AVR-based Arduinos. They included new SDA/SCL pins (redundant from A4/A5) and an IOREF pin (which feeds either 3.3V or 5V...whatever voltage the IO of the shield should run at).
A few shields have started popping up which use these new extended headers. So when we designed the Shield Base, we included these new longer headers too.
Existing shields will continue to work as expected. New "IOREF-aware" shields should see the 3.3V power supply on the IOREF pin and adjust their output accordingly. For digital pins this doesn't matter for Netduino. For analog signals, this should mean 3.3V analog voltages. The Shield Base appears to be the very first 3.3V board using the new pinout, so shield makers can start adapting their shields even before Arduino Due hits the market for the Arduino crowd sometime this year.
Together with a few other enhancements (below) these should take Arduino Shield compatibility to an even higher level.
Digital I/O and pullups/pulldowns
Some robotics projects have needed external pulldowns on digital I/O pins to keep motors from spinning during startup. With Netduino's SAM7X, all pins are in a pull-up state at boot.
With Shield Base, all of the digital I/Os now have their pullups disabled at powerup. Even better, all digital I/Os now have a *pulldown* option as well. This gives more flexibility to projects, and keeps things in a predictable state during boot.
Also of note...each pin on the Shield Base can drive 25mA (maximum of about ~125mA for all IOs combined). So if you have an Arduino shield which needed more current to work properly, this enhancement may foot the bill.
MOSFET control of 3.3V/5V headers
We wanted to make sure that the shield base could boot and request power from the Netduino Go! mainboard before powering up shields. And we wanted to provide a method to power down and repower shields that became unresponsive.
Well there's a really nice dual-MOSFET on the 3.3V and 5V power headers. If you open up pin PB2 ((Cpu.Pin)18) as an OutputPort, you can turn the pins on/off at any time. This also allows your battery-operated projects to conserve some power as your code sees fit.
Limited time: NETMF and 512KB flash MCU
For the Shield Base, we wanted to use the new STM32F2 Cortex-M3 (120MHz) MCU. This will allow us to process a tremendous amount of data with CRCs for seamless virtualized IO.
We wanted to make it possible to build go!bus modules that ran NETMF. And wanted to develop the packet protocol for go!bus using a rapid development platform...so NETMF fit the bill for that perfectly as well. So we thought we should implement the initial Shield Base firmware in NETMF and give early adopters a free upgrade to a 512KB flash chip to say "thank you" for coming along on the journey.
This means that you can effectively use your Shield Base as a 120MHz Netduino. Just plug in 3.3V power from an existing Netduino into the 3.3V power header on the Shield Base. Then connect a USB-TTL serial cable to pins D0/D1 on the shield base. Create project and deploy. That's it.
If you want to use the Shield Base as a standalone board and/or don't have a Netduino Go mainboard, we recommend picking up a Gadgeteer socket breakout board or a $7 go!socket-to-DIP adapter from Proto-Advantage. This will let you reflash your Shield Base and use a fourth "debug/reflash only" serial port with a standalone Shield Base...giving you 3 full serial ports to use for your projects.
We'll be switching the Shield Base MCU to the standard 128KB flash chip this summer, so the NETMF-on-Shield-Base option will be a limited time sort of thing. Hopefully a nice bonus...and its legacy will enable go!modules to be built with NETMF and on-board logic.
MiniJTAG
With traditional Netduinos, we placed the redundant 6-pin "ICSP" header on the right side of the board. This was originally included with Arduino to offer a way to reflash chips directly.
With Netduino Go and the Shield Base, we wanted to give users a low-cost hardware debugging and flashing option for native code. So instead of the 6-pin "ICSP" header we've included the industry-standard MiniJTAG (technically "Cortex Debug Port") header holes. Along with $40 of JTAG debug hardware, you can deploy and debug native code (or for the moment a debug version of the NETMF itself) on this $25 board.
And if for some reason, you have a shield which needs the ICSP header...you can simply sandwich a MakerShield in the middle (or any other shield which routes the SPI and RESET header pins to the ICSP header). Hopefully we got the best of both worlds.
Reset pin
With the Shield Base, it doesn't make much sense to hook up the /RESET pin header to the MCU. But it does make sense to have it reset the mainboard! We're not taking advantage of this yet, but the /RESET pin is now a hardware-enabled interrupt pin instead of an actual RESET pin.
Once we update the firmware to support it, pressing a RESET button on a shield will actually reset the Netduino Go! mainboard. I already saw a sample by Stefan where he hooked up an InterruptPort to pin PB11 ((Cpu.Pin)27) and used NETMF's PowerState class to reboot the board using managed code...pretty nifty.
6 PWM channels
Arduino Uno has 6 PWM channels. Netduino and Netduino Plus have 4 PWM channels (albeit all really nice 16-bit PWM channels).
With Netduino Go, we gave the Shield Base all 6 of those channels. Running on independent timers. With 16-bit to 32-bit PWM. If you picked up a motor shield which had a lonely channel missing out on PWM love, this should be a very happy enhancement.
12-bit ADC
Along with updating PWM, the new microchip allowed us to increase the ADC accuracy from a healthy 10-bit ADC to an awesome 12-bits. On-chip ADCs are generally only really strong at 8-bit to 10-bit resolution, but with some TLC you can take advantage of this 4 time increase in resolution. On all six analog pins.
3 Serial Ports
Not yet part of the Shield Base driver for Netduino Go, but we endowed the Shield Base with three serial ports (one more than Netduino and Netduino Plus). The new serial port is on pins D7/D8 and we muxed it with the RTS/CTS of COM2. So you can use the second serial port with hardware handshaking...or you can get a third serial port.
If you're using the current Shield Base hardware (with its temporarily-upgraded 512KB flash MCU), you can use all three serial ports today. Simultaneously.
We'll be updating the Shield Base firmware and mainboard drivers in the next month or so to enable 3x Serial Port access from the mainboard. Once we get the all-clear from the community on the current featureset of the Shield Base (used as go!module), we will move things over to the fast go!bus channel (instead of the shared UART we're using now) and enable the virtualized SerialPort functionality.
Huge 100uF caps on 3.3V/5V power rails
We wanted to help ensure that circuitry plugged into the shield base would have its own clean power...both so that it could have cleaner ADC readings and so that other modules plugged into the bus would have fluctuations to their power minimized.
So we went all-in...and put two large 100uF tantalum smoothing capacitors on the power rails. One on 3.3V, one on 5V. You'll see them to the left of the power header, dressed in black.
Summary
A Netduino Go combined with a Shield Base will effectively create an "uber-Netduino".
As you use these boards, we welcome your feedback. A lot of community feedback was incorporated directly in these new designs...and we look forward to continuing to integrate your feedback in the future.
Chris
#2
Posted 07 April 2012 - 02:06 PM
#3
Posted 10 April 2012 - 04:14 PM
3 Serial Ports
Not yet part of the Shield Base driver for Netduino Go, but we endowed the Shield Base with three serial ports (one more than Netduino and Netduino Plus). The new serial port is on pins D7/D8 and we muxed it with the RTS/CTS of COM2. So you can use the second serial port with hardware handshaking...or you can get a third serial port.
If you're using the current Shield Base hardware (with its temporarily-upgraded 512KB flash MCU), you can use all three serial ports today. Simultaneously.
We'll be updating the Shield Base firmware and mainboard drivers in the next month or so to enable 3x Serial Port access from the mainboard. Once we get the all-clear from the community on the current featureset of the Shield Base (used as go!module), we will move things over to the fast go!bus channel (instead of the shared UART we're using now) and enable the virtualized SerialPort functionality.
I'm attempting to use the shield base with a Seeed GSM modem, does this comment mean that I will have to wait for a firmware update to use the Virtual Serial port on my Go? There is a seedStudioGSM library that somebody wrote in C# to allow access to the GSM board on the original Netduino, the constructor requires a serial port. I guess I'm just at a loss on how to set up serial communication, this being my first Netduino platform.
#4
Posted 10 April 2012 - 04:17 PM
Hi Russel,I'm attempting to use the shield base with a Seeed GSM modem, does this comment mean that I will have to wait for a firmware update to use the Virtual Serial port on my Go? There is a seedStudioGSM library that somebody wrote in C# to allow access to the GSM board on the original Netduino, the constructor requires a serial port. I guess I'm just at a loss on how to set up serial communication, this being my first Netduino platform.
The serial ports (3 on the shield base!) are currently not available yet when using it as a shieldbase regretfully
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#5
Posted 10 April 2012 - 04:20 PM
Hi Russel,
The serial ports (3 on the shield base!) are currently not available yet when using it as a shieldbase regretfully
Good to know. Well, if you need somebody to beta test that functionality, hit me up! Is there any alternate way of doing this, from the comments it looks like I could write software on the shield base itself to communicate with the modem. Is there a way of calling methods like SendText() from the Go to the shield base running its own code?
#6
Posted 10 April 2012 - 06:11 PM
#7
Posted 10 April 2012 - 06:31 PM
Currently just one. But with the final release I'm hoping on moreAnother noob question: How many shield bases can one connect to a NGO? Is more than 1 a viable option?
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#8
Posted 10 April 2012 - 07:41 PM
You could certainly modify the ShieldBaseProxy code on the shield base...but I'd recommend keeping your logic on the mainboard and using the shield base as a pin expander/shield adapter.Good to know. Well, if you need somebody to beta test that functionality, hit me up! Is there any alternate way of doing this, from the comments it looks like I could write software on the shield base itself to communicate with the modem. Is there a way of calling methods like SendText() from the Go to the shield base running its own code?
Chris
P.S. Once we move the Shield Base's comm channel over to the fast channel, we'll enable the SerialPort feature. In the meantime, you can certainly deploy C# code directly to the current Shield Base in standalone mode using a USB-TTL serial cable. 3x SerialPort and SPI are available there today.
#9
Posted 10 April 2012 - 07:42 PM
As Stefan mentioned, today the limit is one.Another noob question: How many shield bases can one connect to a NGO? Is more than 1 a viable option?
Soon we'll be expanding this to two. Once the Shield Base is out of beta, you'll be able to connect as many as you have sockets and mA to power
Chris
#10
Posted 11 April 2012 - 07:09 AM
#11
Posted 11 April 2012 - 07:25 AM
#12
Posted 11 April 2012 - 06:27 PM
#13
Posted 11 April 2012 - 07:10 PM
That is correct. It will -most likely- be upgradable over the Netduino Go!.Just to confirm, the hardware that is currently sold as "Shield Base Beta" can be upgraded to the "fast comm channel" as well when it is released, right?
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#14
Posted 15 April 2012 - 08:52 PM
I came across a potential problem today, it could be a bug or an issue with either the shield base or RGB display. In any case it most likely is avoidable.
It has to do with a program that works fine when deployed from the computer but appears when you unplug or depower the Neduino Main board and then plug it back in. The main board boots back up ( all blue leds on then off then the module lights come back on as the individual modules are activated by the code in memory.
For instance I hade the following code where the Shield base and the RGB Led module came up first and then the display module, the program would not complete the initization of the display.
Public Module Module1 Dim SB As NetduinoGo.ShieldBase Dim Led As RgbLed Dim canvas As VirtualCanvas Dim TempSensor As AnalogInput Public ReadOnly ColorBackground As UShort = CUShort(BasicColor.Blue) Dim lastTouchX As Integer Dim lastTouchY As Integer Sub Main() SB = New NetduinoGo.ShieldBase(GoSockets.Socket5) Led = New RgbLed TempSensor = New AnalogInput(SB.AnalogChannels.ANALOG_0) canvas = New VirtualCanvas(AddressOf TouchEventHandler, AddressOf WidgetClickedHandler) canvas.Initialize(GoSockets.Socket4) canvas.TouchscreenCalibration()I then re-arranged the code so that the display initialized and then the shield base and RGB Led, and everything worked fine.
Public Module Module1 Dim canvas As VirtualCanvas Dim SB As NetduinoGo.ShieldBase Dim Led As RgbLed Dim TempSensor As AnalogInput Public ReadOnly ColorBackground As UShort = CUShort(BasicColor.Blue) Dim lastTouchX As Integer Dim lastTouchY As Integer Sub Main() canvas = New VirtualCanvas(AddressOf TouchEventHandler, AddressOf WidgetClickedHandler) canvas.Initialize(GoSockets.Socket4) canvas.TouchscreenCalibration() SB = New NetduinoGo.ShieldBase(GoSockets.Socket5) Led = New RgbLed TempSensor = New AnalogInput(SB.AnalogChannels.ANALOG_0)Both arrangements worked when plugged into the computer and the main board has already gone through boot process.
This can be prevented by code, firmware or tribal knowledge and is not a major problem, just something to think about when you have nothing better to do (like sleep).
Thanks,
Chuck
#15
Posted 15 April 2012 - 09:04 PM
#16
Posted 15 April 2012 - 11:52 PM
I only put the top portion in this thread, The entire code was already in the other thread "information on using the shield base".Hi Chuck,
This is really interesting. We'll try to repro. There may be an odd glitch in the NETMF therading system.
BTW, I don't see all of your code here...are you staying in your main thread (or sleeping)?
Chris
Imports System Imports System.IO Imports System.Threading Imports Microsoft.SPOT Imports Microsoft.SPOT.Hardware Imports SecretLabs.NETMF.Hardware.NetduinoGo Imports Nwazet.Go.Fonts Imports Nwazet.Go.Imaging Imports Nwazet.Go.Display.TouchScreen Namespace Basic_go_display Public Module Module1 Dim SB As NetduinoGo.ShieldBase Dim Led As RgbLed Dim TempSensor As AnalogInput Dim canvas As VirtualCanvas Public ReadOnly ColorBackground As UShort = CUShort(BasicColor.Blue) Dim lastTouchX As Integer Dim lastTouchY As Integer Sub Main() SB = New NetduinoGo.ShieldBase(GoSockets.Socket5) Led = New RgbLed TempSensor = New AnalogInput(SB.AnalogChannels.ANALOG_0) canvas = New VirtualCanvas(AddressOf TouchEventHandler, AddressOf WidgetClickedHandler) canvas.Initialize(GoSockets.Socket4) canvas.TouchscreenCalibration() While True WriteTemperature(canvas, GetAverageTemperature) Thread.Sleep(8000) End While canvas.Reboot() canvas.Dispose() End Sub Function GetTemperature() As Single Dim voltage As Single = CSng(TempSensor.Read * 3.3) Return CSng((voltage - 0.5) * 100) End Function Function GetAverageTemperature() As Single Dim TotalTemp As Single = 0 Dim AverageTemp As Single For i = 0 To 19 Step 1 TotalTemp += GetTemperature() Thread.Sleep(50) Next AverageTemp = CSng(TotalTemp / 20) Return AverageTemp End Function Public Sub TouchEventHandler(ByVal touchEvent As TouchEvent) Debug.Print("------------TouchEventHandler------------") Debug.Print("X: " & touchEvent.X.ToString) Debug.Print("Y: " & touchEvent.Y.ToString) Debug.Print("Pressure: " & touchEvent.Pressure.ToString) lastTouchX = touchEvent.X lastTouchY = touchEvent.Y End Sub Public Sub WidgetClickedHandler(ByVal widget As Widget, ByVal touchEvent As TouchEvent) End Sub Public Sub WriteTemperature(ByVal canvas As VirtualCanvas, ByVal CTemp As Single) Dim fontInfo = New Fonts.Verdana14().GetFontInfo() Dim FTemp As Single = CTemp * 9 / 5 + 32 Dim KTemp As Single = CTemp + CSng(273.15) Dim RTemp As Single = FTemp + CSng(459.67) Dim DT As Date = Date.Now Dim CString As String = "Celsius = " + CTemp.ToString("N1") Dim FString As String = "Farenheit = " + FTemp.ToString("N1") Dim KString As String = "Kelvin = " + KTemp.ToString("N1") Dim RString As String = "Rankine = " + RTemp.ToString("N1") canvas.DrawFill(CUShort(ColorBackground)) canvas.DrawString(10, 10, CUShort(BasicColor.White), fontInfo.ID, DT.ToString) canvas.DrawString(10, 50, CUShort(BasicColor.White), fontInfo.ID, CString) canvas.DrawString(10, 80, CUShort(BasicColor.White), fontInfo.ID, FString) canvas.DrawString(10, 110, CUShort(BasicColor.White), fontInfo.ID, KString) canvas.DrawString(10, 140, CUShort(BasicColor.White), fontInfo.ID, RString) If FTemp < 72.0 Then canvas.DrawString(10, 170, CUShort(BasicColor.Cyan), fontInfo.ID, "Damn it's Cold!") Led.SetColor(0, 0, 75) ElseIf FTemp > 78.0 Then canvas.DrawString(10, 170, CUShort(BasicColor.Red), fontInfo.ID, "It's too Hot!") Led.SetColor(75, 0, 0) Else canvas.DrawString(10, 170, CUShort(BasicColor.Green), fontInfo.ID, "It Feels Good.") Led.SetColor(0, 75, 0) End If canvas.Execute() End Sub End Module End NamespaceThis is the broken code, the changes mentioned in the previous post, correct the problem.
I made a video with my sony hd camera now i am trying to get it into a format that I can send to YouTube or post. It is a .MTS file.
Chuck
#17
Posted 16 April 2012 - 07:18 AM
Hi!This is the broken code, the changes mentioned in the previous post, correct the problem.
I made a video with my sony hd camera now i am trying to get it into a format that I can send to YouTube or post. It is a .MTS file.
I'm going to try to reproduce this tonight. I'll keep you posted!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#18
Posted 18 April 2012 - 05:26 PM
Thanks!
Steve
Twiiter: https://twitter.com/Gutworks
#19
Posted 19 April 2012 - 03:30 PM
#20
Posted 05 May 2012 - 12:32 AM
Steve,Is there a Pinout card reference available for the Shield Base? I have used the diagrams found on the Wiki many times and find it incredibly useful. More specifically I'm trying to augment code to allow the Adafruit motor shield use all four PWM's instead of just the two available on the Netduino Plus. At the moment I do know that PWMChannel.PWM_3 refers to digital pin 10, but that's about it for now
Thanks!
Steve
How is the work coming with the Adafruit motor shield?
I am going to be using the shield to drive acouple of RC servos from the shield base.
I don't have the code yet and have to correct a problem with my motor shield (after I did a near perfect job of soldering on the header pins I noticed they were not flush to the board on one side. It would be a pain to use a solder sucker, so I cut the pins apart and un-soldered them).
I won't make that mistake again. A couple of rubber bands would have prevented the problem.
Do you have any code in C# or Visual Basic that you wouldn't mind sharing?
Thanks,
Chuck
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users