The main objective of this document is to serve as a step-by-step guide on how to use some Seeed-Studio® XIAO Series Boards with MicroBlocks® (Block-coding real-time software). (I hope) Maybe soon, Seeed® and MicroBlocks start working together and this document became somehow kind of obsolete.
But, the true is that understanding this process, open the possibility of use not only XIAO, but any other Microcontroller Unit (MCU) compatible board with MicroBlocks or even give to you some ideas on how to design your own physical computing system.
Step 1: Verify your board Microcontroller Unit (MCU) is compatible with MicroBlocks(MB) Virtual Machine (VM)In the next list you can see the MB supported boards and his respective MCU. With this information you can compare if the MCU of your board is the same model of any of the list, if it is the case, you have good chances of success.
- BBC micro:bit - nRF52833 or nRF51822-QFAA-R rev 3
- Calliope mini - nRF52833
- Adafruit Circuit Playground Express - ATSAMD21 ARM Cortex M0
- Adafruit Circuit Playground Bluefruit - nRF52840 Cortex M4
- Adafruit Clue - nRF52840
- Citilab's ED1 - ESP32
- M5Stack Grey - ESP32
- NodeMCU - ESP8266
- ESP32
- Raspberry Pi Pico - RP2040
(Here you can see the source of the information and official list of MicroBlocks compatible boards.)
In the XIAO Boards side, there are many MCU versions that you can see here. So at least 4 versions has MCU in common (Microchip SAMD21, Raspberry Pi RP2040 and the two Nordic models).
Step 2: Find your equivalent MB board flashing procedure and try to replicate with your board.Since this is a practice focused tutorial, instead of only see the available documentation and figure if there are oportunities and limitations, first lets make something in the field.
I'll try with XIAO SAMD21 and XIAO RP2040. So the board equivalent is the CPX and Rpi Pico. In this link down in the board section, you can find the flashing processes for all the board flavors.
In the CPX board you have to double-click on the reset button, the equivalent process in the XIAO Board is not a button, but two terminals that you can connect with a conductive bridge, as you can see in the example video, a jump wire works good.
In the RP2040 you have to press the reset button before you plug in the computer.
If you ned more detailed information about the bootloader modes of XIAO you can find it on his wiki.
For this two boards, once in bootloader mode, you just need to open MB, and flash the XIAO board, selecting the equivalent board, and then this icon should change, so now your Board has MB virtual machine on it!
Safety Note: In case of something goes wrong, it is recomendable to have the original bootloader files, tools and processes for reverting to initial state.
Step 3: Verify the functional pinsIn some cases the MB VM works for boards with specific communication ports or with some components already attached to some pins, like leds, sensor, screens, etc.
With your equivalent board you can have many diferent arrangements and have some pins incompatible, but I hope that all the pins you need stay available. For the comprobation, even there are some reverse engineering methods, I do recommend to find the schematic drawings of both boards so you can directly verify each pin.
Fortunately XIAO and many (or maybe all) of the MB supported boards have documentation available, so I can verifiy the pins one by one.
Let's review my case, for the XIAO SAMD21, I got this file from the Seeed Studio wiki:
And for the Circuit playgroung Express board, I got this file form the Adafruit Learning System Documents,
From the first schematic I can see that the external pin labeled as 0, corresponds to the internal pin PA02, which in the CPX schematic corresponds to the external A0 pin, with an speaker attached, the speaker is a classical and simple communication component, so it is probably that works, with a coincidence in the number.
For the pin comprobation you can use the following code or something similar, depending of your testing component:
In this case, it works! and as a coincidence, with the same pin number (0). Verifying the other available pines. In the comment block, you can read the XIAO pin and in the third block you can see his equivalent pin. After testing all the pins of this board, I got the following results:
As an application of the results, now viewing this image, I know that XIAO pin labeled as 10, works in MB with the number 2.
Next you can see the results for the XIAO RP2040:
In this way is like I've achieved work with this and other boards.
I hope this motivates you for working with Microblocks and XIAO Boards, both are really amazing projects on the state-of-the-art of educational technologies, with a really low-floor learning access, but with high ceiling projects possibilites. Happy Prototyping!! :)
Comments