This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI_Master : Expecting same result in SPI Mode 0 and 3 but it differs

In the sensor datasheet it says one can use SPI_Mode 0 or 3 (doesn't say that there is anything to do to switch between them).

I connected MISO from the DK with SDO from the Sensor and MOSI with SDI

image description

I tried all 4 CPHA/CPOL combinations and 2 should give me the same result.. but they all differ! (Of course I chose a coefficient that should be constant (and with no change in spi mode but just resetting to get the result again it is.).

RX from left to right: reset-command, prom-read-command 0xA6, prom read results

ActiveLow + Trailing : FE FE 92 93 
ActiveLow + Leading : FF FF C9 49 
ActiveHigh + Leading : FE FE FE C8 
ActiveHigh + Trailing : FF FE FE 87

What am I missing? I used the ble_uart example and added SPI. Of course I tried other speeds too.

Maybe someone with a 100% working SPI Slave could flash, just edit the command and test if the code works?

main.c ble_app_uart.zip

Datasheet of Sensor

Parents Reply Children
No Data
Related