Arduino MCP2515 / CAN interface

Is there a compatible library for the MCP2515 chipset? I’ve tried a handful and they all say they are missing SPI_MODE0.

@angus1357

May I know which board and SDK are you using?

Sorry for the delay, I am using the Adafruit MCP2515 Library and the SDK given in the AMB82 mini setup (https://github.com/ambiot/ambpro2_arduino/raw/main/Arduino_package/package_realtek_amebapro2_index.json)

Hi @angus1357,

Right now, we do not have this SPI library. This library will have to be ported to our SDK. Can you screenshot your errors and post them here? You can try to port this library.

Thank you.

Its been a handful of months but I am coming back to this. I realize I’ll have to write the SPI commands myself but can you tell me what the Processor clock speed is in regards to the 2 different SPI channels? CAN communication needs that input to create the right configurations to function. Also a quick explanation of how the CS lines are treated in the SPI.h would be awesome too! I know I can just use SPI.transfer but do I control the CS manually or is it automated somewhere? The examples you provide are not low level and are very tuned to specific examples so they dont really help in this instance.

The error on runtime is this:

07:51:00.812 →
07:51:00.812 → == RAM Start ==
07:51:00.812 → Build @ 14:48:33, Jun 6 2024
07:51:00.812 → [SSI Err]e[31mspi_format(): Invalid Pin seleciton a5.
07:51:00.812 → e[0m [MISC Err]Pin 5[5] is conflicted
07:51:00.812 → [MISC Err]It’s configured as SPI Master/I2S now.
07:51:00.812 → [MISC Err]It’s using by peripheral 50000004
07:51:00.846 → [SSI Err]PIN a5 cannot be registered.
07:51:00.846 → [SSI Err]e[31mspi_format(): SPI 0 init fails.
07:51:00.846 → e[0m [SSI Err]Please initialize SPI format first!
07:51:00.846 →
07:51:00.846 → $8735b> [MISC Err]Pin 4[4] is conflicted
07:51:00.846 → [MISC Err]It’s configured as SPI Master/I2S now.
07:51:00.846 → [MISC Err]It’s using by peripheral 50000004
07:51:00.846 → [SSI Err]PIN 84 cannot be registered.
07:51:00.846 → [SSI Err]e[31mspi_format(): SPI 0 init fails.
07:51:00.878 → e[0m [SSI Err]Please initialize SPI format first!
07:51:00.878 → [SSI Err]Please initialize SPI format first!

Im not sure if thats coming from the AMB side or the MCP driver side!