I am using an Arduino Uno and a Sparkfun CanBus shield to hopefully interface with my car. I have been bang my head on the keyboard trying to get the MCP2515 properly initialised over the SPI bus.
After I write to the CANCTRL register, setting it to Normal(0b0000111) mode, I try to read back CANSTAT to complete the mode change. You will see from my logic analyser the read command and register on MOSI but the value is also returned on MOSI instead of MISO. I'm not sure why this is happening. Any help is much appreciated.
Ok, I cleaned up my code and simplified it removing the functions from the class to make it easier to troubleshoot over a forum. I am trying to set the MCP2515 to NORMAL mode and it doesn't get set. The datasheet specifies that you must write to the CANCTRL register and then read back the value from CANSTAT to finalize the change to the register.