Bare-Metal MCU #3 — Barebones Microcontroller

bhuvaneshwari kanagaraj
3 min readJul 12, 2024

--

Hi everyone, welcome to Day 3 of Bare Metal Coding! Today, we’ll delve into the details of our DIY Arduino.

First, let’s take a closer look at the hardware components. You might be curious about the function of each part. Here’s a quick overview:

The microcontroller used in the Arduino UNO is the ATmega328P.

Arduino Marked!!

We’re going to strip the ATmega328P from the Arduino. You might be wondering why we’re doing this. That’s a good question, and I want you to hold on for a bit to see what happens next.

Alright, let’s take a look inside the datasheet.

ATMEGA 328P Pinout diagram

We know that the LED is connected to Digital Pin 13. The pin-out diagram we reviewed earlier shows that Pin 13 corresponds to PB5, which is pin 19 on the ATmega328P.

Now, let’s connect an LED to pin 19. Be careful while handling the LEDs and microcontrollers. Here’s the final circuit setup.

The LED is connected, along with the resistors, and the ground and VCC are also connected. However, it’s not glowing yet, right?

Yeah, you guessed it right. We need a clock signal. We already have a 16MHz crystal oscillator, but we must connect a capacitor to make everything run smoothly.

All set we have programmed the LED to blink. Before this, the microcontroller should be programmed with Arduino IDE.

This is how you can do this,

Let’s all try out the reset pin. Did you notice the 3 flickers at the start? Guess why these 3 continuous flickers happen? It is because of the bootloader

Bootloader’s work!

Thanks for joining me today. We’ll continue to explore more in our upcoming sessions.

--

--