- Raspberry Pi
- CANPico v2 with Pico WH Pre-Installed
CANPico v2 with Pico WH Pre-Installed
Free Shipping Within The United States!
New version with Pico WH on socketed board. Shipped with Pico WH and MicroPython pre-installed.
Controller Area Network (CAN bus) is a protocol used in hundreds of millions of devices, including cars, trucks, buses, construction machines, ships, tractors, and spacecraft (there is even a CAN bus orbiting Mars). The Canis Labs CANPico is a carrier board in a ‘sock’ format for a Raspberry Pi Pico. Solder on the Pico, and it is connected to an advanced CAN controller and transceiver, ready for connection to CAN bus wires via a simple screw terminal. In addition, the CANPico includes an instrument header with the analog CAN H and CAN L signals and the digital RX and TX signals for use with an oscilloscope or logic analyzer. Software support is via an open-source MicroPython SDK.
The open-source MicroPython SDK from Canis Labs provides a sophisticated CAN API, including priority-inversion free drivers, 1μs accuracy timestamps, large buffers, and an API for triggering a logic analyzer or oscilloscope. And there is support for communicating to a host device over USB (via the MIN protocol) to enable applications like bus logging or even using a CANPico as a PC CAN interface. The SDK also includes the CANHack toolkit for low-level error injection. Finally, the SDK lets Python code run on the dual-core RP2040 microcontroller of the Raspberry Pi Pico and respond in real-time to CAN traffic with times measured in microseconds rather than milliseconds, making it an excellent platform for hardware-in-the-loop test and emulation.
Main hardware features
- Microchip MCP251863T CAN controller
- Screw terminal for direct access to CAN High/Low twisted pair wiring and a common ground reference
- Jumper for a standard 120Ω CAN bus termination resistor
- Jumper for enabling and disabling transmit input to the transceiver
- Header pins for logic analyzer access to digital CAN signals (TX and RX pins of the transceiver)
- Header pins for oscilloscope access to the analog CAN signals (CAN High/Low, ground)
- TRIG pin for logic analyzer and oscilloscope triggering on programmable CAN events
- Direct GPIO access to CAN RX and TX pins for software error injection
- GPIO control over transceiver low power standby
The Raspberry Pi Pico is designed to be soldered onto a board using the ‘half moon’ edges, leaving header pins free. The other connections are USB (for power and connectivity to a host) and the CAN bus. The 6-pin header is intended to support a logic analyzer and oscilloscope to see raw CAN signals. The yellow jumper enables the termination resistor. The blue jumper enables transmission on the bus (when removed, the board is restricted to a listen-only mode, a helpful security feature).
The software support is provided with a MicroPython SDK that has the following APIs:
- CAN API
- CANHack toolkit API
- Trigger API for triggering test instruments on CAN errors and CAN frames with a specified ID and payload
- MIN API to communicate with a host PC over a second virtual USB serial port
The CAN API consists of the following Python classes:
- The CAN class provides control and status of the CAN controller
- The CANFrame class encapsulates CAN frames, which are either created in software or by receiving them from the CAN controller hardware
- The CANError class encapsulates CAN error frames, which are created receiving them from the CAN controller hardware
- The CANID class describes a CAN ID: every CAN frame has a CAN ID, but many frames can have the same ID
- The CANIDFilter class describes how a CAN controller should identify and accept CAN frames based on their CAN ID
The MIN API provides MIN protocol support for reliable communication with a host PC. Some of the CAN API calls use a binary representation to allow items to carry over MIN.
- The Hardware Reference Manual (PDF) for the CANPico board (version 01, issue date 2021-04-29, 8 pages) including schematics.
- The MicroPython SDK Reference Manual (PDF) for the CANPico board (version 01, issue date 2021-04-29, 32 pages). Documents both the MicroPython CAN API and CANHack API.
- The latest firmware (.uf2, release date 2023-03-09). Based on the v1.15 release of MicroPython for the Pico. The source code is released as a patch file for this MicroPython version (see README.txt for details).
- The latest schematics (PDF) and Kicad design (.kicad_pcb) for the CANPico board.
- The canpico.py examples for the CANPico board (the Thonny IDE can be used to put the file on to the Pico file system)
- There is a blog post introducing CANHack and a demonstration video (Note that these both use the CANHack MicroPython API but on the STM32-based PyBoard rather than the Raspberry Pi Pico).
Programming with MicroPython: Embedded Programming with Microcontrollers and Python
It is exciting to get involved with MicroPython, the re-implementation of Python 3 for microcontrollers and embedded systems. This helpful guide presents the knowledge you need to roll up your sleeves and create outstanding embedded projects with this lean and efficient programming language. If you are familiar with Python as a programmer, educator, or maker, you are ready to learn and have fun along the way.
The author takes you on a journey from the first steps to advanced projects. You explore the types of devices that run MicroPython, and examine how the language interacts with hardware to process input, connect to the outside world, communicate wirelessly, make sounds and music, and drive robotics projects.
- Work with MicroPython on four typical devices: PyBoard, the micro:bit, Adafruit’s Circuit Playground Express, and ESP8266/ESP32 boards
- Explore a framework that helps you generate, evaluate, and evolve embedded projects that solve real problems
- Dive into practical MicroPython examples: visual feedback, input and sensing, GPIO, networking, sound and music, and robotics
- Learn how idiomatic MicroPython helps you express a lot with the minimum of resources
- Take the next step by getting involved with the Python community
A short introduction to the Canis Labs CANPico CAN hardware for the Raspberry Pi Pico. Demonstrates sending CAN frames with the MicroPython CAN API and a logic analyzer with a CAN protocol decoder.
An intro to th...A short introduction to the Canis Labs CANPico CAN hardware fo...