Microcontrollers are integral part of embedded systems. A microcontroller is basically cheap and small computer on a single chip that comprises a processor, a small memory, and programmable input-output peripherals. They are meant to be used in automatically controlled products and devices to perform predefined and pre-programmed tasks. To get a better idea of what actually is a microcontroller; let’s see an example of a product where microcontroller is used. A digital thermometer that displays the ambient temperature uses a microcontroller which is connected to a temperature sensor and a display unit (like LCD). The microcontroller here takes the input from temperature sensor in raw form, process it and display it to a small LCD display unit in a human readable form. Similarly a single or multiple microcontrollers are used in many electronic devices according to requirement and complexity of applications.
Where they are used?
Microcontrollers are used in embedded systems, basically a variety of products and devices that are combination of hardware and software, and developed to perform particular functions. A few examples of embedded systems where microcontrollers are used, could be – washing machines, vending machines, microwaves, digital cameras, automobiles, medical equipment, smart phones, smart watches, robots and various home appliances.
Why do we use microcontrollers?
Microcontrollers are used to employ automation in embedded applications. The major reason behind immense popularity of microcontrollers is their ability to reduce size and cost of a product or design, compared to a design that is build using separate microprocessor, memory and input/output devices.
As microcontrollers have features like in-built microprocessor, RAM, ROM, Serial Interfaces, Parallel Interfaces, Analog to Digital Converter (ADC), Digital to Analog Converter (DAC) etc. that makes it easy to build applications around it. In addition, microcontrollers’ programming environment offers vast possibilities to control the different types of applications as per their requirement.
What are the different types of microcontrollers?
There is a wide range of microcontrollers available in the market. Various companies like Atmel, ARM, Microchip, Texas Instruments, Renesas, Freescale, NXP Semiconductors, etc. manufacture different kinds of microcontrollers with different kinds of features. Looking into various parameters like programmable memory, flash size, supply voltage, input/output pins, speed, etc, one can select the right microcontroller for their application.
Let’s have a look to these parameters and different types of microcontrollers according to these parameters.
Data bus (Bit Size):
When classified according to the bit-size, most of the microcontrollers range from 8-bit to 32 bit (higher bit microcontrollers are also available). In an 8-bit microcontroller its data bus consists of 8 data lines, while in a 16-bit microcontroller its data bus consists of 16 data lines and so on for 32 bit and higher microcontrollers.
Memory:
Microcontrollers need memory (RAM, ROM, EPROM, EEPROM, flash memory, etc) to store programs and data. While some microcontrollers have inbuilt memory chips while others require an external memory to be connected. These are called embedded memory microcontrollers and external memory microcontrollers respectively. Inbuilt memory size also varies in different types of microcontrollers and generally you would find microcontrollers with memory of 4B to 4Mb.
Number of Input/Output Pins:
Microcontrollers vary according to the number of input-output pin sizes. One can choose a specific microcontroller as per the requirement of application.
Instruction Set:
There are two types of instruction sets - RISC and CISC. A microcontroller can use RISC (Reduced Instruction Set Computer) or CISC (Complex Instruction Set Computer). As name suggests, RISC reduces the operation time defining the clock cycle of an instruction; while CISC allows applying one instruction as an alternative to many instructions.
Memory Architecture:
There are two types of microcontrollers – Harvard memory architecture microcontrollers and Princeton memory architecture microcontrollers.
Here are some popular microcontrollers among students and hobbyists.
8051 series of microcontrollers (8-bit)
AVR microcontrollers by Atmel (ATtiny, ATmega series)
Microchip’s PIC series microcontrollers
Texas Instruments’ microcontrollers like MSP430
ARM Microcontrollers
Features of Microcontrollers
Microcontrollers are used in embedded systems for their various features. As shown in the below block diagram of a microcontroller, it comprises of processor, I/O pins, serial ports, timers, ADC, DAC, and Interrupt Control.
Processor or CPU
Processor is the brain of a microcontroller. When provided the input through input pins and instructions through programs, it process the data accordingly and provide at the output pins.
Memory
Memory chips are integrated in a microcontroller to store all the programs and data. There could be different types of memory integrated in microcontrollers like RAM, ROM, EPROM, EEPROM, Flash memory, etc.
Input-Output Ports
Every microcontroller has input output ports. Depending on the types of microcontrollers, the number of input output pins may vary. They are used to interface with external input and output devices like sensors, display units, etc.
Serial Ports
They facilitate microcontrollers serial interface with other peripherals. A serial port is a serial communication interface through which information transfers in or out one by one bit at a time.
ADC and DAC
Sometimes embedded systems need to convert data from digital to analog and vice versa. So most of the microcontrollers are incorporated with inbuilt ADC (Analog to Digital Converter) and DAC (Digital to Analog Converters) to perform the required conversion.
Timers
Timers and counters are important parts of embedded systems. They are required for various operations like pulse generation, count external pulses, modulation, oscillation, etc.
Interrupt Control
Interrupt control is one of the powerful features of microcontrollers. It is a sort of a notification which interrupts the ongoing process and instructs to perform the task defined by interrupt control.
To summarize all this up, microcontrollers are sort of compact mini computers which are designed to perform specific tasks in embedded systems. With a wide range of features, their importance and use are vast and they can be found in products and devices across all industries.
[Also read: Difference between microprocessor and microcontroller]