Canis Automotive Labs Is Bringing the CAN Bus to MicroPython on the Raspberry Pi Pico

CAN controller and transceiver boards, plus a custom MicroPython firmware, bring the CAN bus to the RP2040-powered Raspberry Pi Pico.

Canis Automotive Labs has teased a fresh design for add-on boards that put a CAN controller or transceiver onto the $4 Raspberry Pi Pico board, communicating via the SPI bus and leaving all general-purpose input/output (GPIO) pins free.

"The CAN controller board is [...] designed for the Raspberry Pi Pico and gives it a full CAN controller in hardware, connected via SPI," Canis Automotive Labs' Ken Tindell writes of the first in a pair of CAN boards designed to bring the popular bus to the Raspberry Pi Pico, launched late last month. "The controller is the Microchip MCP2518."

"It’s a much more capable CAN controller than the very popular but older MCP2515: It has 2Kbytes of on-chip buffer memory, a receive FIFO, a priority queue for transmitting CAN frames (i.e. transmitting the frame with the lowest CAN ID first), a number of transmit FIFO queues, an event queue to tell the software when frames have been transmitted, and a timestamp system for indicating when a frame was transmitted or received (the CAN start-of-frame event is used for the timestamp)."

The full CAN controller is joined by a second board which connects to the Raspberry Pi Pico in the same way, but this time offering a CAN transceiver. Where the first, jokily dubbed "Yes we CAN," offers a full controller for standalone CAN bus projects, the transceiver, "We can CAN," is designed for use with the CANHack toolkit for sniffing and protocol attack purposes.

Tindell has also unveiled a third CAN bus board, though this one isn't designed for use with the Raspberry Pi Pico. "The CAN probe is designed to be a small low-cost standalone board that a logic analyzer or mixed-signal instrument can use to see what’s happening on the CAN bus," Tindell explains. "The transceiver is powered by a micro-USB connector, and the CAN RX digital line can go into a Sigrok-compatible logic analyzer and run through my CAN2 protocol decoder. The CAN H and CAN L analog lines are also provided so that the input to the transceiver can be seen."

Details on all three boards, which are expected to be launched in the next few weeks, can be found on Tindell's GitHub page. A MicroPython API for the controller board is in the works, with plans to release a pre-compiled firmware "so everyone can get started quickly on CAN projects with the Raspberry Pi Pico as soon as the board is available," Tindell confirms.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Get our weekly newsletter when you join Hackster.
Latest articles
Read more
Related articles