Microcontrollers:
A microcontroller or embedded controller is an IC (Integrated Circuit) that is programmed to have intended control over some arithmetic or logical task. For example, if we consider a calculator, there must be a microcontroller embedded somewhere to ensure that the correct data is calculated with correct precision and appropriate algorithm.
A microcontroller can also be regarded as a small, independent computer that is used just to make sure that the task is being performed correctly.
Advantages of microcontrollers:
- Microcontrollers are less expensive than having a full-fledged microprocessor.
- Microcontrollers consume less power.
- Microcontrollers are small independent computers, hence are fast enough.
Disadvantages of microcontrollers:
- Microcontrollers are designed for specific tasks and are therefore used only in gadgets that perform similar functions.
- Microcontrollers are not true multiprogramming systems.
Components of a Microcontroller: Though a microcontroller is a computer designed for performing a specific or a variety of specified tasks, still it has almost all the major components of a computer architecture. Following are the components of a microcontroller:
- Memory
- I/O ports
- Serial ports
- Timers
- ADC (Analog to Digital Converters)
- DAC (Digital to Analog Converters)
- Interrupt Control
Memory: Memory is the most important component of a microcontroller. It is used either to start/stop programmatically or to perform the tasks appropriately.
A RAM (Random Access Memory) is used to allow programs of significant sizes be processed efficiently by the microprocessor.
A ROM (Read Only Memory) is used in microcontrollers to store those programs that the programmers want to be executed.
I/O ports: I/O ports are used to facilitate external peripheral connectivity. An input port can take inputs from input sources like a sensor and similarly an output port can give output to the output destinations like to an LCD or to a buzzer.
Serial ports: Serial ports are used to facilitate serial communications. Most of the display kind of devices require serial communication, hence for them we need this port in microcontrollers.
Timers: In a microcontroller, there is always a need for sequence counters that can work as clock signals for different activities to trigger. Timers are those kinds of components.
ADC: ADC is an analog to digital converter that can convert analog data/signals to digital data/signals.
DAC: DAC is a digital to analog converter that can convert digital data/signals to analog data/signals.
Interrupt Control: This is a component that keeps track of any interrupt if occurs. Interrupts are urgent I/O signals that need to get executed even by pausing whatever else was happening.
Microcontrollers vs Microprocessors:
- Microcontrollers are used mainly in embedded systems whereas microprocessors are used in computers.
- Microcontrollers have all the components like memory, I/O, Serial ports etc embedded in the same chip whereas in microprocessors, only the CPU is embedded in the chip.
- Microcontrollers are small in size whereas microprocessors when connected with all the components, becomes large and complex circuit.
- Microcontrollers consume less power whereas microprocessors consume more power.
- Microcontrollers are used in application specific systems whereas microprocessors are used in general purpose systems.
Types of Microcontrollers: Microcontrollers are categorised in various ways based on their configurations. Following are the major classifications of microcontrollers:
- Based on bus width: Bus width is the count of lines or wires that are used to transfer one single unit of data. Based on that, microcontrollers can be of 8-bit types, 16-bit type, 32-bit type and 64-bit type.
- Based on memory usage: Microcontrollers are said to have inbuilt or embedded memory system but there are some others that offer connectivity to an external or expanded memory system.
- Based on instruction set: Instruction set is a bunch of several instructions that are needed to accomplish a particular task. A CISC (Complex Instruction Set Computer) microcontroller is one that uses large number instructions for a task. Contrary to that, a RISC (Reduced Instruction Set Computer) microcontroller is one that uses small number instructions for a task.
- Based on architecture: There are two major architectures that are used in computers- the one is Von-Neuman Architecture and the other is Harvard Architecture. Von-Neuman Architecture uses one single memory module for both the data and the programs whereas Harvard Architecture uses separate memory modules for data and programs.
Generally used Microcontrollers:
- PIC Microcontroller: It stands for Peripheral Interface Controller. Its features are:
- Developed by Microchip technology.
- Based on Harvard Architecture.
- Uses RISC instruction set.
- Can be programmed by Assembly or C languages.
- 8051 Microcontroller:
- Developed by Intel Corporation.
- Based on Harvard Architecture.
- Uses CISC instruction set.
- Can be programmed by Assembly or C languages.
- Uses 4kb of ROM and 128bytes of RAM.
- ARM Microcontroller: It stands for Advanced RISC Machine. Its features are:
- Developed by Acorn Computers.
- Was designed with Von-Neuman Architecture but is now based on Harvard Architecture.
- Uses RISC instruction set.
- Can be programmed by Assembly or C languages.