Different SPI Responses (0x4F on Arduino, 0x7F on Raspberry Pi) from the Same SPI Slave

I’m having an issue with SPI communication where the same SPI slave (a sensor) is returning different data on the MISO pin. When I use an Arduino, I get the expected response of 0x4F from the SPI slave. However, when using a Raspberry Pi, I receive 0x7F instead.

Here are the details:

SPI Mode: CPOL = 0, CPHA = 0 (Mode 0) on both devices.
Clock frequency: I’ve tried adjusting the SPI clock frequency on the Raspberry Pi, but it didn’t resolve the issue.
Here are two screenshots showing the SPI waveforms for both cases:

Raspberry Pi (0x7F):

enter image description here

Arduino (0x4F):

enter image description here

Additional details:

The wiring for MOSI, MISO, SCK, and CS is identical in both cases.
Does anyone have an idea why the SPI communication on the Raspberry Pi is not returning the expected response?

Any help or hints would be greatly appreciated!

Read more here: Source link