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.
Thanks Guys! That works like a charm. In case it is useful to others, here is the code I used to directly access the Netduino Go SPI port (i.e. not using a GoBus module):
I have a Netduino Go and Shieldbase used to communicate with my own SPI peripherals. I find this is too slow so I want to be able to use the Netduino Go SPI directly (by manally wiring to a GoBus connector). I know this is not the recommended or even desirable way to use the Netduino Go, but is it possible? When I try to create the SPI port:
SPI.Configuration spiConfiguration = new SPI.Configuration(
I have a Netduino Go and Shieldbase used to communicate with my own SPI peripherals. I find this is too slow so I want to be able to use the Netduino Go SPI directly (by manally wiring to a GoBus connector). I know this is not the recommended or even desirable way to use the Netduino Go, but is it possible? When I try to create the SPI port:
SPI.Configuration spiConfiguration = new SPI.Configuration(
Pins.GPIO_NONE, //Chip Select pin
false, // Chip Select Active State low
0, // Chip Select Setup Time 0us
0, // Chip Select Hold Time 0us
false, // Clock Idle State
true, // Clock Edge
1000, // Clock Rate in kHz
SPI_Devices.SPI1); //SPI Module
SPI spi = new SPI(spiConfiguration);
I get an exception in NetduinoGo.Shieldbase.dll.
Many thanks for any suggestions!
You need to remove all of the GoBus references, at startup they reserve the pins on the uC.
I'm not sure why you are getting an exception in the Shieldbase dll, but you need to specify a pin for the Chip Select.
Also, I and others have run into SPI bugs when running under ~3000 kHz. So you may want to up your speed.
A CS pin isn't expressly needed.
I havn't seen any issues using SPI under 3Mhz, could you share some links?
> You need to remove all of the GoBus references, at startup they reserve the pins on the uC.
Thanks for the help! Can you elaborate on exactly what you mean (sorry I am new at netduino)? I assume you mean remove any GoBus references under References in the Solution Explorer? I tried that and still get the same Exception. The only references I have are Microsoft.SPOT.Hardware, mscorlib, and SecretLabs.NETMF.Hardware.NetduinoPlus.
It makes sense to me that I am getting some kind of collision with the GoBus code. I just don't know how to get rid of all GoBus code... From the call stack (below) it looks like it is trying to use the shieldbase even though I want to use the SPI port on the NetduinoGo directly...
In case it helps, here is the call stack at the exception. It occurs in the main program when I try to create the SPI port:
GoBusSerialTransport.dll!GoBus.GoBusSerialTransport.ResetSlave() Line 1050 + 0x47 bytes C#
GoBusSerialTransport.dll!GoBus.GoBusSerialTransport.GoBusSerialTransport(string portName) Line 178 + 0x2f bytes C#
NetduinoGo.ShieldBase.dll!NetduinoGo.ShieldBase.ShieldBase() Line 146 + 0xfa bytes C#
[External Code]
GoBus.dll!GoBus.GoBusManager.GetShieldBase() Line 36 + 0x23 bytes C#
[External Code]
> NetduinoGoApplication1.exe!NetduinoGoApplication1.Program.Main() Line 218 + 0x1a bytes C#
Hi johncc,
With Netduino Go, the first SPI bus is mapped to the Shield Base. This is designed to provide a consistent and code-compatible experience between Netduino and Netduino Go.
If you want to access the SPI bus directly with Netduino Go you can, but you'll want to remove all GoBus-related assemblies from your project references and then reference the root SPI channel directly. For an example of that, grab the C# driver source for the RGB LED module.
BTW--there's nothing wrong with hacking into your Netduino Go and using SPI directly. Netduino Go is designed for GoBus Virtual I/O...but half the fun of playing with Netduino can be hacking it
Chris
Regarding sources (since you mentions it again), and hacking, how is the progress of getting everything in an repository ?
When one sees the effort community puts into it (regarding the stdfu replacement), an open repository should be of good benefit for all, but still one need to hunt around to find parts of the sources.
> You need to remove all of the GoBus references, at startup they reserve the pins on the uC.
Thanks for the help! Can you elaborate on exactly what you mean (sorry I am new at netduino)? I assume you mean remove any GoBus references under References in the Solution Explorer? I tried that and still get the same Exception. The only references I have are Microsoft.SPOT.Hardware, mscorlib, and SecretLabs.NETMF.Hardware.NetduinoPlus.
Yes that is correct, you want to remove the references. Don't use the NetduinoPlus references, it's pins are not compatible with the Go.
Thanks Guys! That works like a charm. In case it is useful to others, here is the code I used to directly access the Netduino Go SPI port (i.e. not using a GoBus module):