I am interfacing Domino with an IMU I have (ADIS16350) with the initialization string below:
SPI.Configuration imuConfig = new SPI.Configuration((Cpu.Pin)ChipSelect_Port, false, 1, 1, true, true, 300, SPI.SPI_module.SPI1);
However the data I am tapping out doesn’t make sense at all… using the following code
public void getData(double[] data)
{
inBuffer = new ushort[5];
outBuffer = new ushort[5];
outBuffer[0] = (ushort)(READ | XACCL_OUT);
outBuffer[1] = (ushort)(READ | XGYRO_OUT);
outBuffer[2] = (ushort)(READ | YGYRO_OUT);
outBuffer[3] = (ushort)(READ | YACCL_OUT);
outBuffer[4] = (ushort)(READ | ZACCL_OUT);
pSPI.WriteRead(outBuffer, inBuffer);
try
{
// output with conversion values
data[0] = convert14toshort(inBuffer[0]) * 0.07326; // °/s xgyro
data[1] = convert14toshort(inBuffer[1]) * 0.07326; // °/s ygyro
data[2] = convert14toshort(inBuffer[2]) * 2.522; // mg xaccl
data[3] = convert14toshort(inBuffer[3]) * 2.522; // mg yaccl
data[4] = convert14toshort(inBuffer[4]) * 2.522; // mg zaccl
}
catch (IndexOutOfRangeException)
{
Debug.Print("Array too small");
}
finally
{
outBuffer = null;
inBuffer = null;
}
}
I am suspecting the configuration string that is having problems. Would someone try to verify it and suggest a few improvements?
Thanks.