Fab Academy portfolio Sara Kutkova

Week 6: Embedded Programming

This week we worked on embedded programming. We were given a Seeed XIAO RP2040 board from Seeed studios. Overview: https://wiki.seeedstudio.com/XIAO-RP2040/

Figure 1: Hardware overview

Soldering

The useful tutorial to soldering headers here.

I did solder some stuff before, but I am still need more practising. Should’ve watched more tutorials. I like that there are quite a few tools in the lab (such as flux pen and desoldering braid), was happy to get to try all of them.

Figure 2: My workbench setup
   
Figure 3: The Flux pen

Before I started soldering, I turned on the fan. After a bit, I had a first attempt at soldering the headers, but it turned out not ideal.

Figure 4: Messed up solder where two of the rightmost pins are connected together

Therefore, (with Yu-Hans help) I used the disordering braid to remove the excessive tin.

Figure 5: Removing the extra solder

After this I managed to solder the pins (although not beautifully). I now understand that the tin is supposed to cover the “golden” area where the pins are, so they are securely in place. To check that there is no short circuit, I used the voltmeter (the resistance setup) to check all the neighboring pins.

Figure 6: Using voltmeter to check for short circuit
   
Figure 7: Final look on my board after headers are attached

Programming

I wanted to use Arduino to program the board, however for some reason on my computer I couldn’t find the Raspberry Pi Pico/RP2040 - I will solve this problem later, but for now let’s try using the MicroPython and the Thonny IDE.thonny

Installing Thonny:

brew install --cask thonny

I haven’t used MicroPython with a board yet, so it’s a nice learning experience. I am not sure if I would use it in production as it is still Python - too big for some microcontrollers, somewhat clumsy and not real time. But its nice for testing, and I do believe it is easier to program. Documentation can be found here.

The initial setup was a bit tricky, and can be found here. Interesting steps were that the board should be booting when connecting to the computer, and then how MicroPython is installed to the board.

Fist program

To showcase that the board works, and it’s correctly set up, I tried to run one of the default programs (something like blink in the Arduino library).

Figure 8: The first blink program
Figure 9: Board blink

More sophisticated program

I made a program that the colour changes when you press the button.

Figure 10: MicroPython code for blink when button is pressed
Figure 11: The colour changes when the button is pressed

Serial connection

As mentioned, I had problems with Arduino. It turns out it was because I forgot to add Additional Boards Manager URLs in Preferences (as shown in this tutorial). Now, using Arduino interface, I made a simple command like code where the commands I was writing on the computer where changing the LED color on the XIAO board to some pre-defined colors.

Figure 12: Arduino IDE, serial connection with eh board
Video of the code execution: