Skip to content

Know your microcontroller

First and foremost thing you need to do is know what microcontroller you are using. The best way to do it is to find its name. Microcontrollers come in various packages and most common one are as follows

DIP

Photo

LQFP

Photo

UFQFPN

Photo

BGA

Photo

What you are looking for is the unique identifier for it.

Once you have identified it, do a google search and if its a common one, you will certainly find a datasheet for it.

Lets say you search for stm32f103cbt6 (most common microcontroller used in stm blue pill), you will end up onto stm's website. First thing you want to do is look at the brief of that microcontroller, what you are mostly concerned should be, what type ALU/core is it using, is it their custom core, like in AVR atmega series, or is it and arm core, or is it an riscv core. You dont need to know anything about what those cores mean at the start but gradually that would become one of the most important thing that you would look for when starting a project

Next up you want to check the flash and ram quantity, flash is where your code sits and ram is where your variables sit (for now just accept this details) Bigger flash means you can have far more complicated firmware sitting on your microcontroller, and bigger ram means you have bigger variables to do your job, lets say you want to interface a 1.8 inch display which has 240x320 pixels with each pixel being 1 byte, that would mean that you would need 76800 bytes in your ram to store a copy of your display, arduino's microcontroller has got only 2048 bytes in RAM, so you can literally not fit the whole screen as a buffer. But dont worry, that doesnt mean you cant interface it. You certainly can, but there is overhead. You can use clever logic to do so.

Next up you want to whats the max supported core speed, for arduino uno its 16MHz, that means it can only process 16 million instruction in a second, which might seem a lot, but consider this, you want to do something every 5 uS that means the core has 80 clock cycle to do that. which to be honest is not a lot if you want to do anything other then blink led at that rate.

now if you consider stm32f103cbt6 it has a clock speed of 72MHz, that would mean that now you have 360 clock cycle to do the same job, which is considerably more.

Next up, you want to check what hardware peripherals does it have, like UART, i2c, spi, usb, can, twi etc. this just means that you can do all of this in a much easier way. (more on that later, bit banging vs inbuilt uart)

Next up, go and download datasheet and other documents. Have quick glance about it. Dont go reading those 1000s of pages of document just yet.