The question might arise from you when trying to determine what is actually controlling the daily appliances you often meet, such as a printer, microwave, or even a simple line-following robot. Well, the answer you have been seeking is right here in this article. The thing that controls those devices called a microcontroller.
By reading this brief article, we hope that you will get more knowledge about what a microcontroller is, the structure, classifications, the differences between the microcontroller and microprocessor, and working step by step.
What is A Microcontroller?
A microcontroller unit (MCU) is a microcomputer designed and manufactured to meet the need to control the embedded system functions for industrial or office machines, home appliances, robots, motor vehicles, and many more.
It takes shape in a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip.
The advantages of the microcontroller:
- Reusable: programmable to any functions you aim or need.
- Cost-effective: most are available at affordable prices.
- Energy-efficient: commonly uses a 5 Vdc as the working voltage and a really low current.
The disadvantages of the microcontroller:
- Specific function: mostly used in micro to small equipment.
- Complex: the structure is more complex than a microprocessor.
- It needs a “driver” to control or interface a higher power device or equipment such as the motors.
- Limited simultaneous execution number.
The Structure of A Microcontroller
You need to understand these terms before going deeper about the microcontroller. Most of the available microcontrollers out there consist of the following similar parts:
- CPU: as the processing unit to fetch data and to distribute the instructions to related parts.
- Memory: ROM (Read Only Memory) for program memory and RAM (Random Access Memory) for data memory.
- Input/Output ports: as the interface to a specific task such as LCD (display), regulating LED’s on-off pattern, or even instruction for a printer.
- Serial ports: Serial ports have a role as the interface to communicate with various other external devices or peripherals. The most commonly used is the Universal Asynchronous Receiver-Transmitter (UART).
- Timers/Counters: it provides the time delays and counting features of external events. It also has more use to provide such as function generation, pulse width modulation, and clock control.
- ADC: to convert the input analog signal into the digital form that is then used for further process or application such as a measurement instrument.
- DAC: the opposite function of ADC. It is mainly to produce the analog signal output from the processed digital information.
- Interrupts: to give a delayed control when a program is running or working. It can be internal, external, software, or hardware-related.
Microcontroller Vs. Microprocessor
It is in our consideration that you might be confused about the differences between a microcontroller and a microprocessor. The following table is going to tell you about the two.
|Used for an embedded system||Used for a computer system|
|A processor unit along with memory, IO ports, ADC, DAC, timers, serial port, and interrupt system.||Only a processor|
|Small internal circuit||The required circuit is large|
|Low-cost system||High-cost system|
|Low-total power consumption||High-total power consumption|
|Run up to 200MHz or more depending on the architecture||Can run at a very high speed|
|Simple and inexpensive||Complex and expensive|
Microcontroller Types Classification
To get a better whole understanding of the microcontroller, we will present the classification of microcontrollers in this article for you. It can be classified according to the bit number, memory devices, instruction set, memory architecture, and family.
1. Based on the bit number
- 8-bit: performs and executes the arithmetic and logic operations. The examples are PIC1x, Intel 8031/8051, and Motorola MC68HC11 families.
- 16-bit: provides greater precision and performance than the 8-bit. The examples are PIC2x, 8051XA, Intel 8096, and Motorola MC68HC12 families.
- 32-bit: performs the arithmetic and logic operations in the 32-bit instructions. They are mostly used in the engine control system, implantable medical devices, and office machines. The examples are PIC3x and Intel/Atmel 251.
2. Based on the memory devices
- Embedded memory: it has the program and data memory such as Intel 8051.
- External memory: it does not have all the functional blocks like the program memory, such as Intel 8031 has no program memory.
3. Based on the instruction set
- CISC. It stands for Complex Instruction Set Computer, which means one instruction for many simpler instructions.
- RISC. It stands for Reduced Instruction Set Computer, which means enable for instructions to simultaneous access of program and data and operate on any register or use any addressing mode.
4. Based on the memory architecture
- Harvard memory architecture: the memory address space for the program and data memory are not similar.
- Princetown memory architecture: the memory address for the program and data memory is similar.
5. Based on the family types
In this classification, we divide microcontrollers based on the most known ones in the market.
- 8051 Microcontroller
- PIC Microcontroller
- AVR Microcontroller
- ARM Microcontroller
– 8051 Microcontroller
The 8051 microcontroller is one of the old-generation microcontrollers. It is an 8-bit microcontroller based on CISC architecture and launched by Intel corporation back in the year 1981. Further, the 8051 has other two members as well as below:
- 8052 – it has all the 8051 features. The 8051 is basically an 8052 microcontroller subset.
- 8031 – it has all the 8051 features, except it is ROM less. An additional chip can be added as the external ROM.
In case you have become more curious about the 8051, feel free to check the related datasheet below.
– PIC Microcontroller
PIC stands for Peripheral Interface Controller. It is produced by Microchip technology and was first introduced in 1993. The PIC comes with many production codes (types), such as PIC16F84 and PIC16C84. Later on, the Microchip produced more attractive types such as 16F628, 16f877, and 18F452.
– AVR Microcontroller
AVR stands for Alf-Egil Bogen and Vegard Wollan’s RISC processor. It is because AVR is developed by those two. AVR is Harvard RISC architecture with each memory for program and data. In terms of speed, the AVR speed is higher than 8051 and PIC. The AVR divides into three smaller groups as below:
- TinyAVR, best for simple applications as it is small in size and less memory.
- MegaAVR, best for moderate to complex use and the most popular AVR.
- XmegaAVR, best for a complex application that needs high speed and large programs.
– ARM Microcontroller
ARM is a microcontroller with a 32-bit RISC processor and developed by ARM Ltd. It is best known in the mobile electronics world, where less power consumption is the primary aim.
Working Principle of Microcontroller
Now that you know about the classification, it is time to understand its working principle. Keep in mind that the microcontroller executes the instructions at a fast and high speed. As soon as the power streams to the system, the oscillator unit is going to be active. Once the oscillator is active, the stable process condition will soon be achieved to execute the instructions. This all runs based on the oscillator’s CLK (clock) and the instructions are ready to execute. This whole process only requires few nanoseconds.