Embedded programming

Group assignment

The group assignment involved delving into the datasheet for the Xiao SAMD21 microcontroller, comparing its performance and development workflows with other architectures, and documenting the findings.

First, the microcontroller's specs were examined, detailing its pin layout, peripherals, and features like CPU, flash memory, and SRAM.

Next, a comparison with other microcontrollers like Arduino Mega, Arduino Uno, and Raspberry Pi RP2040 Zero was conducted. Each was assessed based on factors like bit size, max clock speed, I/O pins, storage, operating voltage, connectivity, and price. Pros and cons were outlined for each, highlighting their suitability for various projects.

Lastly, the development workflow for programming each microcontroller was explained. This involved setting up the Arduino IDE and writing a simple blink sketch for each board. The process for Xiao SAMD21, Arduino Uno, and Arduino Mega was similar, utilizing the Arduino IDE and C/C++ programming language. Meanwhile, programming the Raspberry Pi RP2040 Zero also involved the Arduino IDE but required additional steps for installing the Arduino Core and board support package.

In summary, the assignment provided a comprehensive understanding of the Xiao SAMD21 microcontroller, its comparison with other architectures, and the development workflows for programming different microcontrollers.


Individual assignment

This week's individual assignment focuses on leveraging the Quentorres board, powered by the Xiao SAMD21 microcontroller, to display a Morse code message using one of its built-in LEDs. The Quentorres board, crafted and documented during the Electronics Production week, provides a compact yet robust platform for embedded programming tasks.

The objective of this assignment is to acquaint ourselves with embedded programming concepts through practical implementation on the Quentorres board. By programming the board to showcase a Morse code message, we aim to grasp essential processes like interfacing with hardware, coding to control peripherals, and translating abstract ideas into visible outputs.

To fulfill this objective, I will engage in two distinct workflows:

  1. Programming with Arduino IDE: We'll utilize the Arduino IDE for writing and uploading code onto the Quentorres board. This approach offers a familiar environment for embedded programming, leveraging the extensive Arduino ecosystem and its libraries. It provides a comfortable entry point for beginners while offering robust capabilities for advanced projects.

  2. Programming with CircuitPython: In addition to the Arduino IDE, we'll explore programming the Quentorres board using CircuitPython. This workflow presents a high-level programming language with simplified syntax, making it accessible to novices while retaining the power needed for sophisticated applications. By delving into both workflows, we seek to gain a comprehensive understanding of embedded programming paradigms and select the most appropriate approach for future projects.

By embracing these methodologies, we anticipate enhancing our proficiency in embedded programming while maximizing the potential of the Quentorres board and the Xiao SAMD21 microcontroller.

Materials Required:

  • Quentorres board
  • Xiao SAMD21 microcontroller
  • USB cable
  • Computer with Arduino IDE and CircuitPython installed

Workflow 1: Programming with Arduino IDE

Setup:

  1. Connect the Quentorres board to your computer using the USB cable.
  2. Install the necessary drivers if required.
  3. Open the Arduino IDE.

Programming Steps:

  1. Configure Arduino IDE:

    • Install the board support package for Xiao SAMD21 microcontroller by adding the appropriate board manager URL to Arduino IDE preferences.
    • Select Xiao SAMD21 microcontroller from the board manager.
  2. Write Code:

    • Open a new sketch in the Arduino IDE.
    • Write the necessary code to control the Quentorres board using the Xiao SAMD21 microcontroller. This may include defining pin configurations, setting up communication protocols, and implementing desired functionalities.
  3. Verify and Upload:

    • Verify the code for any syntax errors or logical issues.
    • Once the code is error-free, upload it to the Xiao SAMD21 microcontroller by selecting the correct port and clicking the upload button.
  4. Test:

    • After uploading the code, disconnect the Quentorres board from the computer and connect it to the appropriate power source.
    • Test the functionality of the programmed features on the Quentorres board to ensure proper operation.

In this week I tried to make the three leds that was connected in to pins 0, 6, and 7 blink continuously: