After some testing, I decided to print out the binary values and found that once the SD card is removed the sensors goes into "command mode". That is for example: 0100111111111110. The 2 first values are the status bits which determine the "Diagnostic Conditions" and should be set to 00, and the rest are the pressure bits.
If the SD is inserted, then the binary values display "normal operation, valid data", that is 00.
The data sheet says: "Command Mode is used for programming the sensor. This mode should not be seen during normal operation."
Does anyone have an idea why this is happening? I have not connected the MOSI.
@defragster: Do you still reckon its the scaling command? If so, what can I change?
Code:
SD card initialization failed
Byte_1 = 10000000 Byte_2 = 0 Bytes: Byte_1 = 1000000 Byte_2 = 0 16384.00, TAS = -430.92 hPa, nan knots
Byte_1 = 1001111 Byte_2 = 11111110 Bytes: Byte_1 = 11001111 Byte_2 = 11111110 -12290.00, AoA = 129.26 hPa
Byte_1 = 11100000 Byte_2 = 0 Bytes: Byte_1 = 1000000 Byte_2 = 0 16384.00, TAS = -172.37 hPa, nan knots
Byte_1 = 1001111 Byte_2 = 11111110 Bytes: Byte_1 = 11001111 Byte_2 = 11111110 -12290.00, AoA = 129.26 hPa
Byte_1 = 11100000 Byte_2 = 0 Bytes: Byte_1 = 1000000 Byte_2 = 0 16384.00, TAS = -172.37 hPa, nan knots
Byte_1 = 1001111 Byte_2 = 11111110 Bytes: Byte_1 = 10001111 Byte_2 = 11111111 -28673.00, AoA = 129.26 hPa
Byte_1 = 11100000 Byte_2 = 0 Bytes: Byte_1 = 1000000 Byte_2 = 0 16384.00, TAS = -172.37 hPa, nan knots
Byte_1 = 1001111 Byte_2 = 11111111 Bytes: Byte_1 = 11001111 Byte_2 = 11111111 -12289.00, AoA = 129.27 hPa
Byte_1 = 11100000 Byte_2 = 0 Bytes: Byte_1 = 1000000 Byte_2 = 0 16384.00, TAS = -172.37 hPa, nan knots
Byte_1 = 1001111 Byte_2 = 11111111 Bytes: Byte_1 = 11001111 Byte_2 = 11111111 -12289.00, AoA = 129.27 hPa
Code:
SD card is ready to use.
Byte_1 = 10000000 Byte_2 = 0 Bytes: Byte_1 = 10000000 Byte_2 = 0 -32768.00, TAS = -430.92 hPa, nan knots
Byte_1 = 11111 Byte_2 = 11111111 Bytes: Byte_1 = 10011111 Byte_2 = 11111111 -24577.00, AoA = -0.01 hPa
Byte_1 = 100000 Byte_2 = 110 Bytes: Byte_1 = 10100000 Byte_2 = 110 -24570.00, TAS = 0.06 hPa, 4.48 knots
Byte_1 = 11111 Byte_2 = 11111111 Bytes: Byte_1 = 10011111 Byte_2 = 11111111 -24577.00, AoA = -0.01 hPa
Byte_1 = 100000 Byte_2 = 11 Bytes: Byte_1 = 10100000 Byte_2 = 11 -24573.00, TAS = 0.03 hPa, 3.16 knots
Byte_1 = 100000 Byte_2 = 1 Bytes: Byte_1 = 10100000 Byte_2 = 1 -24575.00, AoA = 0.01 hPa
Byte_1 = 100000 Byte_2 = 110 Bytes: Byte_1 = 10100000 Byte_2 = 110 -24570.00, TAS = 0.06 hPa, 4.48 knots