Simulated · Communication

CAN bus (MCP2515)

CAN bus (MCP2515): CAN controller, SPI. In Argynix Lab it is fully simulated: wire it to an Arduino, ESP32, STM32 or Raspberry Pi Pico in your browser and run your code against it.

An MCP2515 with its TJA1050 transceiver, as mcp_can, arduino-mcp2515 and the CAN library drive it over SPI: its instructions and registers, the modes (normal, loopback, listen-only, configuration), three transmit and two receive buffers, masks and filters, and INT. Modules whose CANH and CANL share wires are one bus, on one board or between boards: a frame goes at the bit rate the sketch sets, is received by the others set to that rate, and needs one in normal mode to acknowledge it (alone on the pair, it is sent again and again). A node in normal mode at another rate sends error frames over every frame: the sender goes bus-off, and comes back by itself after 128 × 11 recessive bits. Set the crystal as on your module (8 MHz on the common blue one): a sketch that names another runs at another bit rate.

CAN bus (MCP2515) in Argynix Lab

Pins

  • INT (LOW: a frame or an event)
  • SCK
  • SI (MOSI)
  • SO (MISO)
  • CS (chip select)
  • GND
  • VCC
  • CANH (the pair)
  • CANL (the pair)