Skip to main content

Adafruit Feather RP2040 CAN

The most popular board choice for this project. Uses the MCP2515 CAN controller over SPI.

Specifications

PropertyValue
CAN ControllerMCP2515 over SPI
Librarymcp2515.h (autowp)
Driver DefineDRIVER_MCP2515
StatusTested
Case3D Printable (Printables)

Required Pins

The board must expose these pins (defined by the earlephilhower board variant):

PinPurpose
PIN_CAN_CSSPI chip-select for the MCP2515
PIN_CAN_INTERRUPTInterrupt pin (unused; polling mode)
PIN_CAN_STANDBYCAN transceiver standby control
PIN_CAN_RESETMCP2515 hardware reset

Configuration

In sketch_config.h:

#define DRIVER_MCP2515

Arduino IDE Setup

  1. Add board URL: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  2. Install Raspberry PI Pico/RP2040 from Boards Manager
  3. Select Adafruit Feather RP2040 CAN as board
  4. Install MCP2515 by autowp library

PlatformIO

pio run -e feather_rp2040_can
pio run -e feather_rp2040_can --target upload
important

Cut the onboard 120 Ohm termination resistor (jumper labeled TERM). The vehicle's CAN bus already has its own termination.