New Board with RP2040 - Adding pins, multi-processor, and other questions

HI All,
I’m hoping to get through to some folks who know a lot more than me.
I am working on a project for a big client (not to mention the name). We have a new board with an RP2040 chip (Cortex-M0+) and so far, with some help from the core team, I’ve gotten it kind of working.

But to do some operations using GPIO I had to jump through hoops:

  • Use the Edge Connector extension for Micro:bit to expose “pins” blocks in Arcade (even though this board is clearly NOT a micro:bit)
  • Add some manual typescript into the project to pins..setPull(0) to give the switch inputs a pulldown (due to board designer’s choice of button wiring)

Questions: I’m trying to create my own “extension” to add support for this board but to do so with configuration plus pins support, is not at all clear. Yes, I’m reading the documentation but the documentation for creating your own extension is more geared towards generic software and not very clearly connected with the custom hardware documentation. Can someone at least bullet point the list of essential items needed? Creating and cloning a repo is all done and documented okay… it’s just, for a custom board, exactly what is needed in terms of .ts, .h and .json files for defining the board just enough to make projects in arcarde after adding the extension… including the pins.

That’d be awesome!

Another slightly more esoteric question: Does CODAL support the multiple cores in the RP2040? It is a dual-core microcontroller, and it’d be nice if we know that CODAL is allocating processes to both for better performance. (I suspect it is not supported out of the box… in which case what might be needed to make use of the dual ARM cores from PXT or PXT-ARCADE?)

Many thanks.
-Ben.

1 Like

@mmoskal or @peli any pointers here?

As for hardware extensibility I would recommend using Jacdac. We currently have no plans for exposing more low-level ways of interacting with hardware on RP2040.

Codal does not support dual core. You could have the other core due something very specific which does not interact with the reset of the code (eg refreshing the screen or playing music). Otherwise you’ll break lots of assumptions in the code (concurrency issues in GC are surely fun though!).

Hope this helps!
Michal

1 Like

I should be able to use JACDAC thanks. Though our hardware does not at all conform to the physical specs, it does provide enough connection (gnd and two other GPIOs) between boards that would allow us to assign the JACDAC protocol to one of those pins, enabling multi-player.

On that note, in the JACDAC extension, what would you suggest to be the simplest API / Blocks for detecting another board and then initiating communication between them? Or I suppose I would have the users put the game into a level where it’s actively looking for external players on the connection?

Many thanks for your help.
-Ben.

Each role as a “bound” / “unbound” events that you can use to detect that the role has found the necessary Jacdac server. That might work for you.