Week 4 Group Assignments -¶
- Demonstrate and compare the toolchains and development workflows for available embedded architectures
- Document your work to the group work page and reflect on your individual page what you learned
Toolchains and Workflows¶
We reviewed a couple of different workflows for embedding programming. We explored both Arduino IDE and Circuit Python based pathways for programming both XIAO boards and RP2040 boards.
Arduino IDE with XIAO¶
The first workflow that we explored was Arduino IDE and XIAO. This was a relatively straightforward pathway as it just required downloading Arduino software and the XIAO board package. The Arduino version used was the older version 1.8.19. We then downloaded the board package and uploaded a blink sketch to the board.
Circuit Python¶
Before testing Circuit Python, we did some background research. We looked at the XIAO board connection guide and watched Leon Anavi How-To Use CP with XIAO Video. This gave us a good background on how to do it.
The first step was to go to the Circuit Python website and download the .bin file for the XIAO board. For the XIAO ESP32C3 CircuitPython 9.2.4 was the latest stable release and that is what we downloaded and used.
Next we went ahead and downloaded the Thonny Circuit Python editing tool so we could test out writing our own code and communicate with the board. After starting Thonny and plugging in the board, the shell window showed a bunch of errors and would not take any REPL commands as the board did not already have CP running on it.
Before programming the board we had to push the CP .bin file to the board. We plugged the XIAOESP32C3 into the computer and used the Adafruit ESP Tool to upload the .bin file. This just required putting the board into bootmode by holding the reset button and selecting the connect button on the ESP Tool. Then we selected the bin file and pushed upload.
Then we went back to Thonny and the shell window showed that the board was alive and communicating with Thonny. We tested this by running the REPL code:
This queried the board to tell us the pin assigments and it dutifully printed them in the shell window.
The next step was to flash blink code to the device. We found some sample code on a related Wokwi project. We modified the code to point at D5 on the XIAO and flashed it to the board. On the terminal we could see the serial print messages coming through so we know the code was running. Then we hooked up an LED to pin D5 with a 220 Ohm resistor to ground and confirmed that it was indeed blinking properly on the board.
blink.py | |
---|---|
And a video showing it all working together.