MCP_CAN data becomes 0xFF 0xFF... when most significant bit of data high

Hi there,

I am soo bloomin close to having working communications between two MCP2515s using the MCP_CAN library and two ESP32s. Messages fundamentally are sent and received fine, but I’ve noticed if the most significant bit of data, for example:
SEND Extended ID 0x00000356 DLC: 8 Data: 0xF5 0x00 0x00 0x00 0x00 0x00 0x00 0x00
245 0 0 0 0 0 0 0

The receiver always brings back
Extended ID: 0x00000356 DLC: 8 Data: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF

If the most significant bit isn’t high, for example:
SEND Extended ID 0x00000356 DLC: 8 Data: 0x0F 0x15 0xD5 0xFF 0xC8 0xC8 0x00 0x00
15 21 213 255 200 200 0 0 Exiting sendCAN

The received data matches:
Extended ID: 0x00000356 DLC: 8 Data: 0x0F 0x15 0xD5 0xFF 0xC8 0xC8 0x00 0x00

Then it is received fine. I have traced the data out as far as I can go, seems to retain initial values up to sendMsg and no type conversions (all stay within INT8U, but when it comes to this level of detail, my knowledge isn’t there.

Any ideas at all?
Many thanks
Dan

For reference, it was because I was using one of the cheap 3.3V - 5V logic shifters.
Connecting the MOSI, CS and CLK direct to the ESP32 was sufficient to fix the problem as the MCP2515 recognises the 3.3V inputs. MISO/INT should be downshifted to 3.3V of course, but I found the cheap logic shifters was enough for this purpose. Many thanks to mikb55 who suggested logic shifting was the problem.

Thanks for feedback!