"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s." — James Chapman
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. Lorem ipsum dolor amet, consectetur adipiscing elit.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
Brief history of MicrocontrollerMicrocontroller 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 Microcontrollersis an electronic chip which is designed in a way to do general tasks till eternityThe life cycle of Microcontroller'sMicrocontroller is designed from transistors, millions and millions and even billions of transistors are minitirised 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 circuietry 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 arounf the microcontroller is developed to make it use in final end product.Part of Software development for Microcontrolleris called Embedded Software Development and part of Hardware development for MCU is called Embedded Hardware Development.In this video and cahpter 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 understadning and learning.
CPUCPU 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 adaptoped.
- 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 Indias first indegenoious CPU designed by xyz organization
- Examples of CISC is Intel 4004, which is world's first commercially avialable CPU launched in 1971. Another is x86 CPU, most desktops and laptops sold are based on x86 CPU. Ther terminology which we hear intel I5 processor and all they all are part os these CPU's.
Often CPU word/terminology is used interchanagible with processor or core. So whereever 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 pwoerfull and fast tehy 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 micrcontroller interacts with outside world. Their can be more then 20 peripherals in some MCU's and in some MCU's their can be just 5 peripherals.Their 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, wifi 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 peripehral, 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 usecases 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, Ethernt, Wifi 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 handson with Peripherals of MCU is best way as that will make you learn things in practically that how MCU is used to inetract 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 porgraming the microcontrollers. And we can program the microcontrollers using C/CPP language.But these microcontrollers needthis 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 voltaile memory.
- RAM
- Flash
- Peripheral regiserters
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 MCUNow 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".
What things are needed to learn the microcontroller technology??Now to learn any technology, we have to get at first aware with certain tools and frameworks to have a good and smooth learning experience on that technology. Same way in the case of microcontroller, we would group these frameworks and tools in 2 sets:
- Hardware Development Kit(HDK):
- Software Development Kit(SDK):
Lets dwell into these 2 one by one. We will at first start with
Hardware Development Kit, followed by
Software Development Kit.Hardware Development Kit
Hardware Development Kit: in embedded is collection of hardware tools to assist developers to design and prototype the products/projects easily on microcontroller and semiconductor chips.These
hardware tools majorly include:
- Development Boards/Evalution boards
- Debuggers and programmers.
- Cables and connectors
- Hardware Debugging Tools
Why is their need of Hardware Development KitMicrocontrollers are Integrated chips; we can’t use the chips directly as microcontroller are electronic chips. So, they need some power source to get on and work. Apart from the power source they also need some extra electronic circuits so as to function properly. Just like we humans need food and water to live, same way kind of microcontroller need constant power source and electronic circuit to work.Power source that is provided to microcontrollers is of +5 or +3.3 DC voltage. And extra electronic circuit is majorly of oscillator circuit for, some resistors and capacitors for MCU boot-up configurations and miscellaneous. So, these electronic circuitries for power source and miscelleneous is designed on the development boards andAlso as mentioned in last blog, these microcontrollers need to be programmed for their working (Embedded Software/Firmware development). Now we program/write code in our laptops/desktop, this code has to be transferred into the microcontroller. For that thing we need some hardware which transfers the code from our system to the microcontroller memory for execution. This device is called programmer. Along with programmers we often would be using the word debuggers. That is used to debug the program that is written in microcontrollers and see how microcontrollers performs by executing the program line by line. These programmers and debuggers are hardware tools which are necessary for using the microcontrollers, without which we can’t program our microcontrollers. More on programmers and debuggers in below section.Development Boards/Evalution Boards:
Development boards in the field of embedded systems refer to pre-built circuit boards designed to use the microcontrollers/SoC’s. These boards typically include a microcontroller/SoC, along with essential components required to use the microcontroller like:
- Input/Output interfaces (Header pins, LEDs, Push buttons and etc.),
- Power regulators (For powering the MCU/SoC), and
- Miscellaneous circuit required for microcontroller functioning (oscillator circuit, pull-up/down resistors, decoupling capacitors and etc.)
- Debugging and programming feature.
They provide a convenient platform for developers to test their code, interface with external devices, and evaluate the performance of their embedded system designs. These development boards are extensively used among the college students, hobbyists for making DIY projects or learn the microcontroller coding by having hands-on over the microcontrollers using these kind of development boards.
These development boards are connected to Host Desktop/Laptop through USB cable via Debugger/Programmer to program/debug the microcontrollers. Thus, these development board provide easy way to use microcontrollers/microprocessor/SoC. Now for every microcontroller there is a development board for using it. Development boards are designed either by the semiconductor companies itself for their corresponding MCU’s or by the Third-party vendors, like: Arduino is a development board which has
Atmega 328 MCU. Atmega 328 MCU is designed by Microchip Semiconductor company, but
Arduino is designed and developed by Third party organization Arduino.
BluePill is a development board which has
STM32F103 MCU. STM32F103 MCU is designed by STMicroelectronics, but
Bluepill is designed and developed by third party vendors.
ElecronicsV1 is development board which has
S32K144 Automotive MCU. S32K144 is designed by NXP Semiconductors, but
ElecronicsV1 is designed and developed by Gettobyte community.So, you can see in all development boards mentioned above, there are header pins which exposes all or majority of pins of corresponding MCU/SoC, the have either on-board debuggers or support of attaching external debuggers for programming/debugging them and electronic circuits for powering them and miscellaneous circuits.
Debuggers/ProgrammersFor programming the microcontrollers we need some form of debuggers and programmers. Debuggers and programmers are external hardware for microcontrollers. There are industry specified protocols like JTAG and SWD, through which microcontrollers are programmed and debugged. All the ARM CPU Based MCU's support the debugging feature in them via the SWD (Serial Wire Debug)
. For Programming the Microcontrollers, their is mandatory need of some Programmer/Debugger, that one can get to know from the webpage of corresponding microcontroller.- On some Development boards there are on board debuggers either JTAG support, or SWD support or proprietary debug interface of semiconductor company (like OpenSDA from NXP semiconductors, CC Debugger from Texas Instruments, STLINKV2/3 from STMicroelectronics, PICKit from Microchip, DEBUGADPTR1-USB from Silicon Labs and etc.).
- Also, there are external debuggers like STLINKV2, OpenSDA Cyclone, Seger universal debugger, PEMicro . Which are used with developments that does not have on-board debug interface.
Hardware Debugging Tools
- Logic Analyzer
- Multimeter
- CAN Anlayzer Tool's
- Oscilliscope's
Cables/Connectors and jumper Wires
For Connecting sensors and modules with microcontrollers, there is need of wires. Those Wires are termed as Jumper Wires. Also, sometimes to make firm and proper connection there is need connectors, to make circuits clean and neat. To connect Microcontrollers to Host Desktop via programmers/debuggers, their is use of Cables. Multiple type of Cables are used, like USB Type C, mini USB Cables and etc. Depending on the kind of connection given on Development board of MCU.