Hello Fiends,
This topic is for beginners, who doesn't know what is Microcontroller? And wants to explore the world of Microcontroller. As as beginner for exploring MCU first basic things that you are aware of Basic of C Language, basic of electronics. just that you are get set go....
Let’s start with the microcontroller.
What is a Microcontroller?
A microcontroller also called MCUs or Microcontroller Unit is a single
integrated circuit (IC) that is used for a specific application and designed
to implement certain tasks.
As you can see Microcontroller as small /Portable computer. It works as
same as laptop or computers.
Essentially, a microcontroller works to gather input, process the
information, and output a particular action based on the information
gathered.
Microcontrollers or MCUs can operate at lower speeds, for example, it can
operate at around in 1MHz to 200 MHz of range, and is designed to consume
less power because they’re embedded inside the other devices,
which have greater power consumptions in other areas.
The elements of a microcontroller
The elements of microcontrollers are:
·
The Central Processing Unit (CPU)
·
The Random-Access Memory (RAM)
·
The Read-Only Memory (ROM)
·
The Input/output Ports (I/O Ports)
·
Internal Oscillator
·
The Electrical Erasable Programmable Read-Only Memory (EEPROM)
1. Central Processing Unit (CPU):
It is essentially known as the brain of the microcomputer. This element of
the microcontroller is a microprocessor that controls and monitors all the
processes taking place inside the microcontroller unit (MCU). It’s
responsible for the reading and execution of all arithmetic and mathematical
functions that have been performed.
2. Random-Access Memory (RAM):
It is a temporary storage memory that stores information only when the
power is on. It helps to run and calculate the programs which the MCU is
told to execute. It is continually overwritten while in use.
3. Read-Only Memory (ROM):
It is a pre-written permanent storage memory that can work even when the
power is off. It essentially instructs the microcontroller on how to execute
its calculation and programs when asked.
4. Input/Output Ports (I/O Ports):
The I/O ports consist of one or more communications ports, typically in the
form of connective pins. They permit the MCU to be connected to other
components and circuits for the flow of input/output data signals and power
supply.
5. Internal Oscillator:
Also known as the main timer of the
MCU. The Internal Oscillator functions as the microcontroller’s core clock
and controls the execution rhythms of its internal processes. Similarly, any
other kind of timer keeps track of your time because it elapses during a
given process, and helps the MCU to start and end specific functions at
specified intervals.
6. The Electrical Erasable Programmable Read-Only Memory (EEPROM):
It is a kind of non-volatile memory used by MCU. Electrical Erasable
Programmable Read-Only Memory stores amounts of data and information by
allowing individual bytes to be erased and reprogrammed.
7. Analog to Digital Converter (ADC):
This is a single used to convert analog signals to
digital signals. It permits the processor of the MCU to interface with
external analog devices, for example – sensors. It can be used for various
digital applications, e.g. measurement devices.
8. Digital to Analog Converter (DAC):
This is the reverse of ADC that means converts digital signals to analog
signals and permits the processor of the MCU to communicate its outgoing
signals to external analog components. It is usually used for controlling
analog devices like DC motors, various drives, etc.
How Microcontroller do works?
A microcontroller is embedded inside a system to regulate a singular
function in a device. It does regulate by interpreting data it receives from
its Input-Output peripherals using its central processor.
It stores temporary data and the temporary information received by a
microcontroller is stored in its data memory, where the processor can access
it and uses the stored instructions in its program memory to convert it into
normal language and apply the incoming data. Then it uses its I/O
peripherals to communicate and apply the suitable action.
Microcontrollers or MCUs are used in a wide range of systems and devices.
Many devices often used multiple microcontrollers that work together in one
device to handle their respective tasks.
For example, a car might consist of many microcontrollers that have the
power to control various individual systems within, like the anti-lock
braking system, fuel injection system, traction control, or suspension
control. In this system, all the microcontrollers communicate with each
other to take the proper actions.
Some other microcontrollers may communicate with a more complex central
computer within the car, and others may communicate with other
microcontrollers only. They can send and receive data by using their I/O
peripherals and process that data to perform their designated
tasks.
Types of microcontrollers
The microcontrollers are characterized regarding bus-width, instruction set, and memory
structure. The types of microcontrollers are shown in figure, they are characterized by their
bits, memory architecture, memory/devices and instruction set.
Classification According to Number of Bits
It generally refers to the parallel lines that connect the various
components. Its function is to transmit data between CPU, Memory, and
Input/output Ports. Microcontrollers contain three types of buses
inside it: data bus, address bus, and control bus. It is divided into three
types- 8,16, 32 bits microcontrollers.
-
8-bits Microcontroller:
The bus width of such microcontrollers is 8 bit which means 1 byte wide long. It means it can transfer & process the information of 8 bits in a single cycle. the point when the internal bus is 8bits then the ALU is performs the arithmetic and logic operations. To process outsized data for example 16 bit, it uses multiple cycles to finish an easy mathematical function. It results in poor performance of the general logic circuit. Common examples of 8-bit microcontrollers are Intel 8031/8051, PIC1x and Motorola MC68HC11 families.
The bus width of such a microcontroller is 16 bits that means 2 bytes wide long. It can transfer & process information of 16 bits in a single cycle. microcontroller performs greater precision and performance as compared to 8bits. For example, 8-bit microcontrollers can only use 8 bits, resulting in a final range of 0×00 – 0xFF (0255) for every cycle. 16-bit microcontrollers with its 16-bit data width have a range of 0×0000 – 0xFFFF (065535) for every cycle And its 16-bit timer provides a wide range of 0x0000 (0) to 0xFFFF (65535) which provides the most effective accuracy per cost for any application or project that requires Timer functions. Some examples of it are 8051XA, PIC2x, Intel 8096, etc.
-
32-bits Microcontroller:
A 32-bit microcontroller contains a bus width of 32 bits which is 4 bytes
long. The performance & accuracy of such microcontrollers is higher than
any other microcontrollers but they’re a bit expensive & consume lots of
power.
It can even support multiple peripherals required in any embedded system
projects or applications like Universal Serial Bus (USB), Ethernet,
Universal Asynchronous Receiver-Transmitter devices (UARTS), and a
Controller Area Network (CAN) bus.
These are used in automatically
controlled devices including
implantable medical devices, engine control systems, office machines, appliances
and other types of embedded systems
Some common examples of 32-bit microcontrollers are Intel/Atmel 251 family,
and PIC3x, etc.
Classification According to Memory Devices
The memory devices are divided into two types, they are
·
Embedded memory microcontroller
·
External memory microcontroller
-
Embedded Memory Microcontroller:
Embedded memory means all the memory blocks and modules are in
a single package. This functional block includes program & data memory,
Timers & counters, interrupts, etc. Memory blocks are fixed and cannot
be expandable but in microcontrollers, ROM can extend its memory. For example, 8051 having program &
data memory, I/O ports, serial communication,
counters and timers and interrupts on
the chip is an embedded
microcontroller
-
External Memory Microcontroller:
This kind of microcontroller doesn’t have one among the essential memory
blocks inside its chip & it has to be connected externally to function
properly. The use of external modules increases the dimensions of the
overall device. For example, 8031 has no program memory on the chip is an external
memory microcontroller.
Classification According to Instruction Set
-
CISC (Complex Instruction Set Computer)
- RISC (Reduced Instruction Set Computers)
CISC: CISC is a Complex Instruction Set Computer. It allows the programmer to use one
instruction in place of many simpler instructions. In this kind of microcontroller, the CPU is designed to execute one or
single complex command. It can execute multiple instructions by using a
single instruction. It has a small-sized program and that is its advantage.
But because of the large size of its instruction set with many addressing
modes, it takes a multiple machine cycle to execute & result in a long
time to perform.
RISC: The RISC is stands for Reduced Instruction set
Computer. This type of instruction sets
reduces the design of microprocessor for industry standards. It allows each instruction to
operate on any register or use any addressing mode and simultaneous access of program
and data.
RISC systems shorten execution time by reducing the clock cycles per instruction
and CISC systems
shorten execution time by reducing the number of instructions per
program. The RISC gives a better execution than the CISC. In this kind of microcontroller, the CPU is designed to execute small and
simple complex commands. It takes only one machine to execute a single
instruction hence, the instruction can be reduced to execute complex
instructions.
Classification According to Memory
Architecture
Memory architecture of microcontroller are two types, they are namely:
·
Harvard memory architecture microcontroller
·
Princeton memory architecture microcontroller
Harvard Memory Architecture Microcontroller:
Many years ago, in the late 1940's, the US Government asked Harvard and Princeton
universities to come up with a computer architecture to be used in computing distances of
Naval artillery shell for defense applications.
Princeton suggested computer architecture with a single memory interface.
It is also known as Von Neumann
architecture after the name of the
chief scientist of the project in
Princeton University John Von Neumann.
Harvard suggested a computer with two different memory interfaces, one for the data /
variables and the other for program / instructions.
Although Princeton architecture was accepted for simplicity and ease of implementation,
Harvard architecture became popular later, due
to the parallelism of instruction
execution.
The point when a microcontroller unit has a dissimilar memory address space for
the program and data memory, the microcontroller has Harvard memory architecture in the processor. It is a type of microcontroller that has complete instruction in one machine
cycle. It has two separate bus lines and separate memory storage for program
code (instructions), the data, program memory & the data memory
respectively. Its cost is higher due to its complex design.
Princeton Memory Architecture Microcontroller: (Single memory interface)
It uses single memory for the program and data storage. It
is a widely used architecture in various computers, desktops, and laptops.
It required two machine cycles to complete an instruction. Its cost is very
low as compared to Harvard architecture because it uses a single bus and its
design is also
simple. Example: An instruction "Read a data byte from memory and store it in the accumulator" is
executed as follows:
Cycle 1 Read Instruction
Cycle 2 Read Data out of RAM and put into Accumulator
The point when a microcontroller has a common memory address for the program memory
and data memory, the microcontroller has Princeton memory architecture in the processor.
Types of Microcontrollers used are-
-
PIC Microcontroller: Features of PIC Microcontroller are-
-
No internal oscillator
-
40 pin IC in DIP packaging with 33 pins available for I/O
-
Uses external clock up to 20 MHz as there is no internal clock
-
Smaller instructions set of 35
-
Operating voltage ranges from 4.2v to 5.5v.
-
8051 Microcontroller: Features of 8051 Microcontroller are-
-
8bit microcontroller available in 40 pin DIP
-
4Kb on-chip programmable ROM for storing program code
-
128 bytes on-chip RAM for temporary data storage
-
40 pin IC in DIP packaging with 32 pins available for I/O
-
AVR Microcontroller: Features of AVR Microcontroller are-
-
Having an internal oscillator of 8MHz
-
1Kb on-chip programmable ROM for storing program code
-
32Kb on-chip RAM for temporary data storage
-
4 PWM channels for generating pulses
-
It contains three timers which include two 8-bit timers & one
16-bit timer.
-
ARM Microcontroller: Features of ARM Microcontroller are-
-
32-bit RISC processor
-
energy efficient having higher performance
-
Cortex M0 processor that offers low speed at low cost
-
Based on Harvard architecture
-
RENESAS Microcontroller: Features of RENESAS Microcontroller are-
-
Based on CISC Harvard architecture
-
8-bit & 16-bit microcontroller whereas RX is a 32-bit
microcontroller
-
Low power microcontroller is RL78 while RX offers high performance
& efficiency
-
RX family RAM ranges in the form of 2KB to 128KB
-