Week 6 assignment: Embedded programming

Summary

This week I had the goal of programming the electronic board that was created in week 4. The programming was done in Arduino IDE and it was relatively easy to download the board packages.

Process

The board used was the Seeed Studio XIAO SAMD21, providede by my instructor. It uses a ATSAMD21G18A-MU microcontroller that consume less power and has good performance. It is suitable for small projects.

The following image shows the possible connections we can make. It has multiple development interfaces: 11 digital/analog pins, 10 PWM Pins, 1 DAC output, 1 SWD Bonding pad interface, 1 I2C interface, 1 UART interface, 1 SPI interface.


Programming using Arduino IDE


The first thing we have to do is download the program and run it. Then, in the preferences option we have to add this board as it is has not been installed when downloading the program. We need to copy the url into this part.

After this, we have to install the name of the board: Seeed SAMD Boards (in the photo it it already installed).

Finally, we have to choose the installed board for programming on it. For this we go to Tools -> board ->Seeed SAMD Boards -> Seeeduino XIAO.

The check corresponds to compiling the program to verify errors, and the arrow pointing to the right corresponds to loading the program on the XIAO board.


Now we are ready to enter our first code to the board. This code corresponds to the 3 LEDs turning on when the button is pressed, if not, the leds will turn off. It is important to always place the semicolon at the end of each sentence, if not an error message will appear when compiling the program.
Leds are connected to ports 0,6 and 7 and are configured as outputs, while the button is connected to the port 1 and is configured as input.



Files:
XIAO_SAMD21 Library



Programming code