Skip to content

Embedded Programming Week

For this week’s group assignment, we explored the different microcontrollers available in our lab. We decided to focus on three specific boards: the Arduino UNO, XIAO ESP32C3, and ATtiny 44.

Our goal wasn’t just to test them, but to actually understand their specifications like their pin configurations and how to program them, and to see how they differ from each other. This helped us get a better understanding of what each board can do.

We used the Arduino IDE to write our code. It let us compile, debug, and upload the program to the board.

Arduino UNO

Board Specifications:

The Arduino UNO R3 is the most popular board in the Arduino family and is perfect for beginners like us. It runs on the ATmega328P chip and is designed to be really easy to use for learning electronics and coding.

Board

Name SKU
Arduino UNO R3 A000066

Microcontroller

Component Specification
Microcontroller ATmega328P
USB Connector USB-B

Pins

Feature Specification
Built-in LED Pin 13
Digital I/O Pins 14
Analog Input Pins 6
PWM Pins 6

Communication

Protocol Supported
UART Yes
I2C Yes
SPI Yes

Power

Feature Specification
I/O Voltage 5V
Input Voltage (nominal) 7-12V
DC Current per I/O Pin 20 mA
Power Supply Connector Barrel Plug

Clock Speed

Processor Speed
Main Processor ATmega328P 16 MHz
USB-Serial Processor ATmega16U2 16 MHz

Memory

Component Specification
ATmega328P 2KB SRAM, 32KB FLASH, 1KB EEPROM

Dimensions

Feature Specification
Weight 25 g
Width 53.4 mm
Length 68.6 mm

The above information was taken from the datasheet of the board. Here is the link to the datasheet

For this week’s assignment, we used the classic Blink example that comes with the Arduino IDE.

To open it, we went to: File > Examples > Basics > Blink

Here is the code we used:

void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
delay(1000);                      // wait for a second
digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
delay(1000);                      // wait for a second
}

For the Arduino UNO R3 we first connected the board to the computer and then uploaded the code. Don’t forget to add the board and the port!

Yay! Our LED is blinking!

XIAO ESP32C3

Board Specifications:

The Seeed Studio XIAO ESP32C3 is a tiny microcontroller board powered by the Espressif ESP32-C3 RISC-V chip, and it’s made for IoT and wearable projects. It has 2.4GHz Wi-Fi and Bluetooth 5.0 (LE) packed into a really small size. It also has a built-in battery charging chip and uses very little power, which makes it great for battery-powered projects where space is tight.

Board

Name SKU
Seeed Studio XIAO ESP32C3 113991054

Microcontroller

Component Specification
Microcontroller ESP32-C3 SoC (32-bit RISC-V)
USB Connector USB Type-C

Pins

Feature Specification
Built-in LED Pin N/A (Charge LED only)
Digital I/O Pins 11
Analog Input Pins 4
PWM Pins 11

Communication

Protocol Supported
UART Yes
I2C Yes
SPI Yes

Power

Feature Specification
I/O Voltage 3.3V
Input Voltage (nominal) 5V (USB) / 3.7V (Battery)
DC Current per I/O Pin 40 mA (Max)
Power Supply Connector USB Type-C / Battery Pads

Clock Speed

Processor Speed
Main Processor 160 MHz
USB-Serial Processor Native Internal USB Serial/JTAG

Memory

Component Specification
ESP32-C3 400KB SRAM, 4MB Flash

Dimensions

Feature Specification
Weight ~3 g
Width 17.5 mm
Length 21 mm

The above information was taken from the datasheet of the board. Here is the link to the datasheet

We used the same code, but since the XIAO ESP32C3 doesn’t have a built-in LED, we used the GPIO10 pin to turn an external LED on and off. Don’t forget to add the board and the port!

Yay! Our LED is blinking!

ATtiny 44

Board Specifications:

The ATtiny44 is a tiny, low-power microcontroller that’s great for small and compact projects. It has 12 I/O pins and 4KB of memory.

Board

Name Value
Name ATtiny44A
Manufacturer Atmel (Microchip)

Microcontroller

Component Specification
Microcontroller ATtiny44A
USB Connector None

Pins

Feature Specification
Built-in LED Pin None
Digital I/O Pins 12
Analog Input Pins 8
PWM Pins 4

Communication

Protocol Supported
UART No
I2C Yes (USI)
SPI Yes (USI)

Power

Feature Specification
I/O Voltage 1.8V – 5.5V
Input Voltage (nominal) 1.8V – 5.5V
DC Current per I/O Pin 40 mA
Power Supply Connector VCC Pin

Clock Speed

Processor Speed
Main Processor Up to 20 MHz
Internal RC Oscillator 8 MHz

Memory

Component Specification
ATtiny44A 256B SRAM, 4KB Flash, 256B EEPROM

Dimensions & Package

Feature Specification
Available Packages 14-pin PDIP, 14-pin SOIC, QFN/MLF, VQFN, UFBGA
Operating Temperature –40°C to +85°C

For the ATtiny 44, we used an ATtiny 44 circuit board that students in the lab had made before. To program it we used Arduino as ISP as shown below.

ISP is basically a way to program a microcontroller while it’s already on a circuit board, so you don’t have to take the chip out and put it in a separate programmer.

After that, use the default Blink code but change the pin number to the one your LED is connected to. Our pin is PA2.

Don’t forget to add the board and the port!

Reflection

This week was a really great learning experience for us. We compared the Arduino UNO, XIAO ESP32C3, and ATtiny44 by looking at their datasheets and programming all three of them to blink an LED. We learned how different they are in terms of specs and how you program them, especially using ISP for the ATtiny. Now we have a much better idea of how to pick the right microcontroller depending on what kind of project we’re working on.