OpenCyphalPicoBase - a node with Raspberry Pi Pico and MCP2515

Hardware

During the construction of the L3X-Z hexapod we had to develop several OpenCyphal nodes. One was the leg controller which is already described in the L3X-Z thread. The second type of node is the auxiliary controller which controls the less important task like the state of the emergency switch or the warning lights.
At first this controller was only some Arduino on a bread board like this:

and that:

But now this has emerged into a own board: The OpenCyphalPicoBase

It is based on a Raspberry Pi Pico which is mounted on the back and uses a MCP2515 CAN controller. Because of the difficult supply situation in 2022 I also used a THT footprint for the controller because these parts were sometimes better available. Additionally it has an I2C eeprom to store settings in a way that they are able to survive a firmware update.
As there were some pins left I implemented more functions than we actually needed for the L3X-Z. I supports the following functions:

  • measurement of bus voltage
  • internal temperature of RP2040
  • 4 digital inputs
  • 2 analog inputs
  • 2 digital outputs
  • 2 servo outputs
  • 1 connector for NeoPixel leds

This a photo of the mostly assembled board now:

The Raspberry Pi Pico can be stacked on headers on the bottom side to easily replace it in case of failure. It turned out that this is not necessary so it can be directly soldered on the board. Unfortunatelly I didn’t take enough care of the USB connector so it is difficult to solder and connect. I will fix this in a later release.

All the design data including schematic and KiCAD project file is available in my github repo:

Software

As this is a more generic board it is open to all kinds of software. For the L3X-Z hexapod we tried to implement a software which covers all inputs and outputs of the board and gives some lighting functions but not more.

This software is based on the Arduino framework and is also available on github:

This software relies heavily on the 107-Arduino-Cyphal library and tries to make use of all its functions. Unfortunatelly it is also bound to its restrictions. So no configurable subject-ids so far. The rest like Node Info, Execute Command and Register API should work.

This is the output of yakut monitor:

And these are the implemented registers:

{                                              
  "99": {
    "aux.updateinterval.analoginput0": 500,
    "aux.updateinterval.analoginput1": 500,
    "aux.updateinterval.input0": 500,
    "aux.updateinterval.input1": 500,
    "aux.updateinterval.input2": 500,
    "aux.updateinterval.input3": 500,
    "aux.updateinterval.inputvoltage": 3000,
    "aux.updateinterval.internaltemperature": 10000,
    "aux.updateinterval.light": 250,
    "uavcan.node.description": "L3X-Z AUX_CONTROLLER",
    "uavcan.node.id": 99,
    "uavcan.pub.analoginput0.id": 2008,
    "uavcan.pub.analoginput0.type": "uavcan.primitive.scalar.Integer16.1.0",
    "uavcan.pub.analoginput1.id": 2009,
    "uavcan.pub.analoginput1.type": "uavcan.primitive.scalar.Integer16.1.0",
    "uavcan.pub.input0.id": 2000,
    "uavcan.pub.input0.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.pub.input1.id": 2001,
    "uavcan.pub.input1.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.pub.input2.id": 2002,
    "uavcan.pub.input2.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.pub.input3.id": 2003,
    "uavcan.pub.input3.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.pub.inputvoltage.id": 1001,
    "uavcan.pub.inputvoltage.type": "uavcan.primitive.scalar.Real32.1.0",
    "uavcan.pub.internaltemperature.id": 1010,
    "uavcan.pub.internaltemperature.type": "uavcan.primitive.scalar.Real32.1.0",
    "uavcan.sub.led1.id": 1005,
    "uavcan.sub.led1.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.sub.lightmode.id": 2010,
    "uavcan.sub.lightmode.type": "uavcan.primitive.scalar.Integer8.1.0",
    "uavcan.sub.output0.id": 2004,
    "uavcan.sub.output0.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.sub.output1.id": 2005,
    "uavcan.sub.output1.type": "uavcan.primitive.scalar.Bit.1.0",
    "uavcan.sub.servo0.id": 2006,
    "uavcan.sub.servo0.type": "uavcan.primitive.scalar.Integer16.1.0",
    "uavcan.sub.servo1.id": 2007,
    "uavcan.sub.servo1.type": "uavcan.primitive.scalar.Integer16.1.0"
  }
}

further development

The next planned steps are:

  • implement storage of settings to eeprom
  • configurable subject-ids
  • rework pcb and make it smaller

If you have questions feel free to ask or post an issue on github.

2 Likes

I have two:

  1. Can one run MicroPython on this board to benefit from PyCyphal?

  2. Are there plans to support Ethernet for Cyphal/UDP, perhaps via Microchip ENC28J60 or similar, in a future hardware revision?

Let’s hope this critical piece of the protocol is supported sooner rather than later!

1 Like

This board is based on the Raspberry Pi Pico so it is definitely capable of running MicroPython. And there seems to be a driver for the MCP2515, so yes, it should be possible.

Unfortunatelly I’m not into Python so there won’t be any tests from my side. If you know anyone who is willing to try it I can send her or him one or two boards.

Nope, not really. This board is tailored to Cyphal/CAN.

A possibility might be to use the Raspberry Pi Pico W with the WiFi chip and run Cyphal/UDP over WiFi. But this is not on my roadmap.

Definitely. I would like to have a complete and working implementation of Cyphal on this board!

I would try it myself but at this moment there’s a blocker – PyCyphal is not yet out-of-the-box usable with MicroPython:

I don’t think it will take too much effort to render it compatible with MicroPython though. If anyone reading this is interested in this, we could use a hand.

1 Like

@pavel.kirienko I will do the redesign of the boards and as soons as the new ones arrive I will send you one.

1 Like