Hi, I am using .netmf boards from GHI for my project and I just got my pixy, everything is fine using Arduino & PixyMon but I found it difficult for me to translate the provided arduino code to .netmf as the arduino SPI library is very different from .net SPI. So is it possible that someone provide a sample for .netmf using SPI interface?
Hi Ahmed,
I’m not familiar with .NETMF. How exactly is the SPI library different from Arduino’s? I’ll do what I can to help, but we’re working on supporting other devices for Pixy, so we won’t be able to do a full port to .NETMF anytime soon.
Scott
The .Net SPI library support the following methods
.Write(byte[] bytesToWrite)
.WriteRead(byte[] bytesToWrite, byte[] readBuffer)
and type safety is always insured even using unsafe * reference in c# so lines like (Block* block;… block = ((UInt16*)blocks) + blockCount;) cant be translated without fully understanding what is
And the SPI constructor requires some config parameters that I couldn’t find their values in the wiki
// chipSelectActiveState:
// The active state for the chip-select port. If true, the chip-select port
// will be set to high when accessing the chip; if false, the chip select port
// will be set to low when accessing the chip.
//
// chipSelectSetupTime:
// The amount of time (in milliseconds) that will elapse between the time at
// which the device is selected and the time at which the clock and the clock
// data transmission will start.
//
// chipSelectHoldTime:
// The amount of time (in milliseconds) that the chip select port must remain
// in the active state before the device is unselected, or the amount of time
// (in milliseconds) that the chip select will remain in the active state after
// the data read/write transaction has been completed.
//
// clockIdleState:
// The idle state of the clock. If true, the serial peripheral interface (SPI)
// clock signal will be set to high while the device is idle; if false, the
// SPI clock signal will be set to low while the device is idle. The idle state
// occurs whenever the chip is not selected.
//
// clockEdge:
// The sampling clock edge. If true, data is sampled on the SPI clock rising
// edge; if false, the data is sampled on the SPI clock falling edge.
//
// clockRateKHz:
// The SPI clock rate in kHz.
public Configuration(bool chipSelectActiveState, uint chipSelectSetupTime, uint chipSelectHoldTime, bool clockIdleState, bool clockEdge, uint clockRateKHz);
My main issue is getBlocks method
Hi Ahmed
Do you got lucky?
I’m trying to use Netduino and you know…
JB
I’m using I2C… but that’s not the issue.