Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Microsoft.SPOT.Hardware.dll -- Exception while using SPI

63 views
Skip to first unread message

anan...@gmail.com

unread,
Feb 17, 2014, 2:18:07 PM2/17/14
to
The error I get while trying to use the SPI driver is as follows:

The thread '<No Name>' (0x2) has exited with code 0 (0x0).
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] ####
#### Microsoft.SPOT.Hardware.SPI::.ctor [IP: 002c] ####
#### Samraksh.SPOT.Testing.SPITest::.ctor [IP: 0015] ####
#### Samraksh.SPOT.Testing.SPITest::Main [IP: 0004] ####
A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll


I read this post -- https://groups.google.com/forum/#!topic/microsoft.public.dotnet.framework.microframework/VTwmaXj10OM -- and other similar posts and all of them mention that the pin is being assigned somewhere else. My code is very simple and the pin that I use is not being assigned anywhere. Given below is the portion in the code where this error happens:

_spi0 = new SPI(new SPI.Configuration(Cpu.Pin.GPIO_Pin10, false, 0, 0, false,
false, 2, SPI.SPI_module.SPI2));


I have tested the same configuration from a native (C++) code and I am able to verify that SPI works.


Please let me know what is wrong with the code pasted above.

Thanks.

0 new messages