What is Microcontroller Technology?
Brief history of Microcontroller
Microcontroller is an innovative technology that has revolutionize the world and made the electronic items so much feasible for us. Though microcontrollers have been in world since 1960’s. Its been around 60 years since the invention of Microcontroller technology and their are more then x amount of microcontroller being deployed right now in world.
Lets explore and go back to history of microcontroller’s:
What are Microcontrollers
is an electronic chip which is designed in a way to do general tasks till eternity
The life cycle of Microcontroller's
Microcontroller is designed from transistors, millions and millions and even billions of transistors are miniaturized into small size, to form building blocks of MCU, and these building blocks give them ability to control anything. The building blocks of MCU are: CPU, Memory and Peripherals. We will dive into these blocks after couple of minutes. The designing of these transistors is an art and science behind the chip designing. This art of technology is called as VLSI( Very Large Scale Integration). And Once the designing is done then these Chips are fabricated/manufactured to give us a final by product that is physical MCU chip. And This part is done by fabrication companies like TSMC. And after that fabrication, the packaging/assemble of integrated chip happens so that these millions and millions of transistors which are minitiasuered are enabled for practical usage in electronic devices.
And after that programming on these MCU and extra circuitry around these MCU’s is developed to make the MCU do any specific task till eternity. These part are referred as Embedded Systems, in which software and hardware around the microcontroller is developed to make it use in final end product.
Part of Software development for Microcontroller is called Embedded Software Development and part of Hardware development for MCU is called Embedded Hardware Development.
In this video and chapter we will just get ourselves stick to microcontroller technology, and focus on what things are involved for learning and using microcontroller. Though their are many topics and technologies which can be deep dive, which we will do in separate videos.
Building blocks of Microcontroller chip are
Microcontroller chips have 3 building block, first is CPU, second is Memory and third is peripherals. For better understanding take the analogy of microcontroller with human body. Just like their is human body, same way their is microcontroller.
- In human body we have brain which does all the processing, calculations and thinking. In the case of microcontroller, CPU does all that.
- Then in human body we have body parts to interact with outside world, same way microcontroller have different peripherals to interact with outside world.
- We humans have memory/yadash based on which we do the work and do the tasks. How to sit, how to walk, how to use legs, how to use different body parents, and all these things are feed in our memory, same way microcontrollers have memory, into which instructions are written on how to use its different peripherals and how to control those peripherals and what to do when some data comes from those peripherals.
Now lets just deep dive into these functional blocks in more technical understanding and learning.
CPU
CPU stands for Central Processing Unit, it is an integral part of microcontroller which does all the hardcore computing work. computing work in terms of electronic chip means: addition, subtraction, multiplication, division of electronic data. How fast this can be done and level of complex calculations it can do.
CPU does the computing work, by a set of basic rules on how a CPU should work. These set of rules are called as Instruction Set Architecture(ISA). Their are 2 most popular types of ISA:
- RISC( Reduced Instruction Set Computer)
- CISC(Complex Instruction Set Computer)
In Current modern world, RISC architecture based CPUs and microcontroller are what is widely used and adapted.
- Examples of RISC is ARM CPU that we see in Apple MAC book the M1 chip. another example is RISC-5 CPU, that we can see in Vega processor, which is India’s first indigenous CPU designed by xyz organization
- Examples of CISC is Intel 4004, which is world’s first commercially available CPU launched in 1971. Another is x86 CPU, most desktops and laptops sold are based on x86 CPU. Their terminology which we hear intel I5 processor and all they all are part of these CPU’s.
Often CPU word/terminology is used interchangeable with processor or core. So wherever we mention, processor/core or CPU words they mean same thing.
Another important factor on which CPU computing work matters is bit size of CPU. Meaning how much size of data CPU can execute at a time. We measure this thing in bits unit. So their are 8 bits, 16 bits and 32 bits CPU’s. In which 8 bit CPU means it can at a time can execute data of 8 bit length. 16 and 32 bit CPU means they can execute data of 16 bit and 32 bit length. Now as the bit size of CPU increases, it means more powerful and fast they are.
For now we are not going too much in detail about CPU types, history and its world as that will deviate us from current topic of microcontroller. We will explore in detail about these terminologies in what is microprocessor technology.
Peripherals:
Peripherals are body parts of Microcontroller, it is peripherals through which microcontroller interacts with outside world. There can be more then 20 peripherals in some MCU’s and in some MCU’s their can be just 5 peripherals.
There are some general purpose peripheral which are their in all or most of the MCU’s: which are GPIO, ADC, TIMERS, I2C, SPI, UART.
Using these peripherals one can process and control any sensor/module connected to MCU. I2C, SPI and UART are communication protocol via which we can connect almost any sensor/module to MCU. Be it LCD screen, ethernet module, audio devices, Wi-Fi modules or any other sensor.
And via GPIO, TIMER and ADC peripherals we can sample and generate digital/analog signals of various natures. Their are number of applications and sensors, where we want to generate digital/analog signals like for controlling speed of motors, light brightness and where we want to sample these digital and analog signals for sensor readings. As you see by default world is analog in nature, earth magnetic fields, wind around us, oxygen level around us and all are by default in analog in nature. And So to measure them via MCU’s we need some peripherals that can sample these analog/digital signals.
Now their can be peripherals in MCU concentric to certain applications also. Like if we want to connect camera to a MCU, it will have CSI peripheral, If we want to connect or interact with some Touch screen displays it will have MIPI peripheral, if we want to connect some audio devices, then MCU’s have I2S and DAC Peripherals, if we want to use ethernet technology, then MCU’s have ethernet peripherals. If we want to do AI on MCU’s then in MCU their are peripherals concentric to run AI models. If we want to do cryptography that is secure the data transmission then MCU’s have peripheral concentric to cryptography application. The USB ports that we use in PC’s/laptops, that too is implemented by USB peripheral present in some MCU’s.
Peripherals are like the unsung and mostly widely underestimated topic in microcontroller technology. As Industry or most of working professionals direct jump onto application building instead of understanding these peripherals of MCU. Without peripherals microcontroller is just human brain with no body parts.
Thus having an understanding of how MCU peripherals work and their use cases is very important.
Most widely used peripherals are GPIO, UART, I2C, SPI, TIMERS, ADC. These are some of the basic and most widely used peripheral of a MCU that is used in every product/industry. After that according to application, their can be different peripherals present in MCU’s. We can divide the peripherals of Microcontroller in roughly 4 categories:
- Communication peripherals like: CAN, LIN, UART, SPI, Ethernet, Wi-Fi and etc.
- Digital and Analog peripherals: TIMERS, GPIO, ADC, DAC and etc.
- Programming and Debugging peripherals : JTAG, SWD, ISP and etc.
- Reset and Clock Pins: XTAL1 and XTAL2, system reset and bootloader pins
- Memory Peripherals: Flash, EEPROM, SRAM and etc.
- System Peripherals like : DMA. Interrupts, WatchDog, Low Power Modes and etc.
Good level of understanding of these peripherals is highly needed and recommended to have when working with MCU’s.
To start learning Microcontroller technology, starting by learning and doing hands on with Peripherals of MCU is best way as that will make you learn things in practically that how MCU is used to interact with outside world. We will dive more into topic and understanding of IP cores in upcoming videos. For now lets move to next functional block that is memory in microcontrollers.
Memory:
Now microcontrollers are programmable devices, that is we can program the microcontrollers on how they should work, which peripherals we want to use and how to use and all. All this thing is done by programming the microcontrollers. And we can program the microcontrollers using C/CPP language.
But these microcontrollers need
this program would be stored somewhere, and that will be stored in memory of microcontroller. So their are 2 types of memory in microcontroller:
Volatile memory and non volatile memory.
- RAM
- Flash
- Peripheral registers
Functional Topics of Microcontrollers
Pins in Microcontroller:
Pins of microcontroller are physical end points through which MCU interacts with the outside world. Microcontrollers have pins through which it transfers and receives the data to the outside world.
Now you take any microcontroller, every microcontroller will have 2 types of Pins:
Power Pins: Power pins are pins of MCU through which MCU gets electric Power. All of the Microcontroller operates at 5 Volats. In Every Microcontroller, we will find their are pins by name of VCC/GND. Vcc is one on which +5/+3.3 volts is given and GND is grounded. Apart from these their are other Miscellaneous Power pins for analog circuitery and all.
Input/Output pins: Input output pins are the pins which act as an mediator to transfer data to the peripheral’s of MCU, which need data from the otside world. T Peripherals like that of Communication, Digital and Analog, Programming and Debugging, Reset and Clock pins need some MCU pins for exchange of data to outside world. So these pins are categorised in terms of these peripherals of MCU.
- Like UART peripheral which implements the UART protocol, need RX and TX pins for doing UART communication. So MCU has pins of this nature termed as UART pins: UART_Rx and UART_Tx.
- SPI peripheral which implements the SPI protocol, need MOSI/MISO/SCK/CE pins for doing SPI communication. So MCU has pins of this nature termed as SPI pins.: SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CE
- Timer peripheral which is used to generate digital pulses or sample digital pulses, need
So we can divide input/output pins of mcu in terms of these peripherals present in mcu.
- So their are Communication peripherals like: CAN, LIN, UART, SPI and etc. For each peripheral their are corresponding Communication pins
- Digital and Analog peripherals like: TIMERS, GPIO, ADC, DAC and etc. In these peripherals their are concepts of channels. The Pins which are their for these peripherals are referred as channels.
- Programming and Debugging pins: JTAG, SWD, ISP and etc. These are factory default pins, which we dont change in most of the cases.
- Reset and Clock Pins: XTAL1 and XTAL2, system reset and bootloader pins. These are also factory default pins, which we dont change in most of the cases.
Now for referring to these pins of MCU, their are concepts of Ports in Microcontroller. Dont worry its not adani ports!!!!!
Basically grouping is done of MCU pins and each group is called as PORT. And these groups are named according to alphabetical order. PORTA, PORTB, PORTC, PORTD and etc. And in each port max to max 32 pins can be fit in. So Pins are named as PTA1, PTA2…. PTA31, PTB1, PTB2, PTB3 …. PTB31, PTC1, PTC2, PTC3 ….. PTC31 and etc. Now how many ports and pins in each port are their can varry greatly from microcontroller to microcontroller. Some Microcontroller have only 2 ports and some have more then 8 ports. Some microcontroller have 2 pins per port and some MCU have 32 pins per port.
In detailing for each peripherals categories and their pins we will dwell into video ” What are peripherals in microcontrollers”.
Clock in MCU
Now microcontroller technology has a concept of clocks. These are not watches that we have or in walls!!!!!
One can see that their are many components in a microcontroller: CPU, memory and then number of peripherals. All these units should worked in a synchronized way. By synchronized way we mean that when peripheral receives or transmits the data at that time, memory of MCU should also be updated and then simultaneously CPU should process the data. If this synchronization is not mainatned, means new data on peripheral comes in or out before that data gets processed properly will cause errors and mishaving.
For this synchronization, in microcontrollers their is concept of clocks. Clocks provide a Frequency of digital pulses at which these systems should operate. Faster the frequency faster the MCU can execute and process the data.
So clock is needed to generate frequencies for synchornization of various components of MCU. Take it in a way the human body works, if brain is not synchronized with our hands and legs then we will not be able to move in a desired way. Sameway if clock is not their then MCU units will not be synchronzed with each other and work in undired way.
So now this frequency is generated by electrical circuits called: oscillators. Oscillators are eternal part microcontroller. Oscillators are electrical circuits that can convert the current from DC source into a continous alternating digital waveform. As MCU are powered with DC source, so oscillators convert this DC source into digital waveforms. And then this digitak wavewforms are fed to number of units.
So, these oscillators are clock sources for microcontroller’s to generate the clock frequencies. And their can be 2 types of Clock sources:
Either internal oscillator or External Oscillator.
In the case of Internal Oscillator, MCU chip in it has built in oscillator minitiasered into it. And in the case of External Oscillator, we attach the crystal oscillator to the clock pins of the microcontroller.
Now thier are 2 concepts used in clock configuration of MCU:
First is concept of PLL. That is abrievted as Phase Locked Loop, which are used to increase the MCU system clock frequency. PLL are another types of electrical circuits which can enhance the output signals frequency on feeding them with input signal. So normally first Clock source is finalised and if we need more clock frequency value to run the systems then PLL is used to get the final Clock frequency. If clock frequency is sufficent from internal/external clock then no PLL is used.
Another concept is of Divider/Prescaler in clock configuration, just like their is PLL for increasing the Clock frequency, their is a clock divider circuit, that reduces the frequnecy of an input clock signal to create a lower frequency clock signal.
Now after generating the frequency from clock sources, comes the concept of clock destination. That is in which all systems this generated clock has to be fed into. These are termed as clock destination’s or clock consumers:
And mainly their are 2 clock consumers:
- Peripheral clock control: This module basically configures, controls, and generates the clock for each of the peripherals of the MCU via system clock frequency
- Internal bus clocks: These are buses which are connecting peripherals to CPU systems. So we have to configure clock for these buses to.
Microcontroller to Microcontroller, their can be different naming convections and process to configure the clock. We will dive deep into how to confugure clock of microcontrollers in a spearate video: . In this video we will return to our topic of microcontroller technology introduction.
Who develops the Microcontroller?
// In this brief about semiconductor companies, what all things do they develope( SDK and HDK).
Microcontrollers are designed and developed by the semiconductor companies. Their are number of semiconductor companies: . Name of semiconductor companies like: NXP, Renesas, STM, Texas, Nordic, Silicon , Marvel and etc.
Now Semiconductor industry is a multi-billion dollar industry, companies are as big as google, amazon and microsoft.
Take example of iphone 16, in that microcontroller of xyz company is used and iphones are produced with a volume of xyz numbers. So company whose MCU will be used will be having so many large order value.
Semiconductor companies can also be divided into 2 types: .
Now semiconductor companies not only designs and develops the mcu chips, but they also need to give software packages to use the mcu peripherals and hardware kits for hassle free use of mcu’s around their mcu chips so that product development companies can make their prototype their product easily and more sustaininbly.
Microcontroller are developed by semiconductor companies. Semiconductor compa
Categories of MCU's:
Now their are number of microcontrollers in Industry. We can divide the microcontroller’s according to different categories:
- In terms of CPU Size( 8 bit, 16 bit or 32 bit)
- In terms of CPU Cores ( ARM, RISV-5 , power and etc)
- In terms of MCU peripherals( automotive, AI, iot, general purpose)
- In terms of Semiconductor Companies
- First is CPU size. CPU size of 8 bit, 16 bit or 32 bit. MCU having 8 bit size are slower and can handle less number of complex application. Whereas MCU having 32 bit size are faster and can handle much complex applications. Like in traditional TV/AC/Electric remotes, hair machines, are all built on 8 bit MCU’s. Applications like that of fridges, Car speedometer, smart watches are all built on 32 bit MCU. Examples most widely used development board arduino is built on 8 bit mcu, and ElecronicsV3 Development, most widely used automotive hardware kit is built on 32 bit mcu.
- In terms of cores is ARM CPU or RISC-5 CPU. These 2 CPU architectures are most widely used in modern era. Now their ca
- In terms of MCU peripherals: Now Peripherals can be
ab ek microcontroller peh hamare peripherals hote han jise it communicates to outside world, kuch peripherals peh tu sabhi mcu peh comman hote but kuch mcu peh according to applications kaphi extra and advance peripherals hote. Jase STM32 ki mcu peh usb peripheral han jise voh usp protocol kar skta, but arduino ke mcu peh usb peripheral nhi hota.
Ase hi kuc mcu peh in build rfid/wifi/ble/ethernet ke peripherals hote and kuch mcu peh nhi/.
Kuch mcu peh automotive application concentric peripherals hote jase cryptography engine, automotive protocols and kuch mcu peh nhi. JAse NXP S32K1 and S32K3xx peh kaphi sare automotive concentric peripherals han and stm32 and esp jase mcu peh automotive concentric periphertals nhi han.
List or bhi kaphi badi hu jygi, but ase hi according to medical, drones and etc applications ke concentric mcu peh peripherals hote and en peripherals ke basis peh hi we can categories to different mcu’s.
- Then final one comes in terms of semiconductor companies: Now MCU kaphi sare companies banati.
Kuch companies ki specialise hoti 8 bit mcu banane peh, kuch companies ki risc-5 cpu based mcu banane peh, kuch companies ki power electronics applications ke hisab se peripheral based mcu banane peh and kuch companies ki automotive applications ke hisab se peripheral based mcu banane peh. So we many a times categories mcu based on which company have designed and developed them.
Jase Arduino Atmega 328 mcu joh arduino boards peh hota voh microchip technologies ki company ne banaya han. yeh ek 8 bit mcu han.
STM32 mcu’s joh STMIcroelectronics company ne banaya han, yeh ek 32 bit or arm cpu based mcu han.
ase hi elecronicsv3, jispeh s32k144 mcu han voh nxp semiconductor company ne banya han . yeh mcu specifically for automotive application ke liye han.
Ase hi kaphi sari semiconductor companies han jase ki: Texas instruments, renesas, silicon labs, nordic semiconductors and etc etc joh mcu banati han. We will deep dive into exploring mcu from these companies in video ” Exploring websites of semiconductor companies”.
Now that all in this video, now from next video we will deep dive into on how to start with microcontroller technology?
Author: Kunal Gupta
Author