Blog
Recent Posts
Raspberry Pi Pico CAN Bus System with Micro-Python Installed
Posted by
onThe Raspberry Pi PicoBoard is an inexpensive and versatile development board designed for the RP2040 microcontroller chip developed by Raspberry Pi. It features an RP2040 microcontroller chip with 2MB of Flash, and a micro-USB port for power, data, and programming. The 40-pin dip-style header provides 26 multi-function 3.3V GPIO, 23 digital-only GPIO, and three ADC-compatible GPIO for additional functionality. Additionally, the Pico development board includes a 3-pin Arm® serial wire debug (SWD) port for troubleshooting and monitoring.
The CANPico v2 is an improved CAN Bus module version with a Pico WH installed on a socketed board. It is shipped with Pico WH and MicroPython pre-installed.
Controller Area Network (CAN Bus) is a protocol utilized in millions of devices, including cars, trucks, buses, construction machines, ships, tractors, and even spacecraft (there is even a CAN module orbiting Mars).
The Canis Labs CANPico is a carrier board designed in a 'sock' format for a Raspberry Pi Pico. You can solder the Pico onto the board, and it will be connected to an advanced CAN controller and transceiver, ready to be linked to CAN bus wires using a simple screw terminal. Additionally, the CANPico includes an instrument header with the analog CAN H and CAN L signals and the digital RX and TX signals, which can be used with an oscilloscope or logic analyzer. Software support is provided through an open-source MicroPython SDK.
Canis Labs' open-source MicroPython SDK offers a comprehensive CAN API that includes priority-inversion-free drivers, 1μs accuracy timestamps, large buffers, and an API for triggering a logic analyzer or oscilloscope. It also supports communication with a host device over USB (via the MIN protocol) to enable applications such as bus logging or using a CANPico as a PC CAN interface.
The SDK also includes the CANHack toolkit for low-level error injection. Additionally, the SDK allows Python code to run on the Raspberry Pi Pico's dual-core RP2040 microcontroller and respond in real-time to CAN traffic with times measured in microseconds rather than milliseconds. This makes it an excellent platform for hardware-in-the-loop testing 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
Interfacing
- 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
Get started with MicroPython on Raspberry Pi Pico
Microcontrollers, such as the chip at the heart of Raspberry Pi Pico, are essentially stripped-down computers. They don't require monitors or keyboards; instead, you program them using USB to take input from and send output to on-board input/output pins.
Using these programmable connections, you can illuminate LEDs, generate sounds, display text on screens, and perform many other tasks. In "Get Started with MicroPython on Raspberry Pi Pico, 2nd Edition," you will learn how to use the beginner-friendly MicroPython language to write programs.
During the course, you will learn how to connect hardware so that your Raspberry Pi Pico can interact with its surroundings. Once you've mastered these skills, you can create your own electromechanical projects, whether for fun or to make your life easier.
Fully updated for Raspberry Pi Pico W and the latest version of MicroPython, this book shows you how to:
- Get started with Raspberry Pi Pico and Pico W
- Work with various electronic components
- Create your programmable electronic contraptions
- Turn Raspberry Pi Pico W into a network-connected node for the Internet of Things
- Link your Pico W to your smartphone, tablet, or another Pico W with Bluetooth Low Energy (BLE)
Whether you’re using Raspberry Pi Pico for a home project, industrial automation, or learning (or teaching!) electronics and programming, this book will show you how. More Information...