What is a Microcontroller?
PS: This post is the continuation of the post INTRODUCTION TO PIC.
A microcontroller is a single chip microcomputer made through VLSI fabrication. A microcontroller also called an embedded controller because the microcontroller and its support circuits are often built into, or embedded in, the devices they control. A microcontroller is available in different word lengths like microprocessors (4bit,8bit,16bit,32bit,64bit and 128-bit microcontrollers are available today).
1) A microcontroller basically contains one or more following components:
- Central processing unit(CPU)
- Random Access Memory)(RAM)
- Read Only Memory(ROM)
- Input/output ports
- Timers and Counters
- Interrupt Controls
- Analog to digital converters
- Digital analog converters
- Serial interfacing ports
- Oscillatory circuits
2) A microcontroller internally consists of all features required for a computing system and functions as a computer without adding any external digital parts in it.
3) Most of the pins in the microcontroller chip can be made programmable by the user.
4) A microcontroller has many bit handling instructions that can be easily understood by the programmer.
5) A microcontroller is capable of handling Boolean functions.
6) Higher speed and performance.
7) On-chip ROM structure in a microcontroller provides better firmware security.
8 ) Easy to design with low cost and small size.
The basic structure and block diagram of a microcontroller is shown in the fig (1.1).
CPU is the brain of a microcontroller. CPU is responsible for fetching the instruction, decodes it, then finally executed. CPU connects every part of a microcontroller into a single system. The primary function of CPU is fetching and decoding instructions. The instruction fetched from program memory must be decoded by the CPU.
The function of memory in a microcontroller is the same as a microprocessor. It is used to store data and program. A microcontroller usually has a certain amount of RAM and ROM (EEPROM, EPROM, etc) or flash memories for storing program source codes.
Parallel input/output ports
Parallel input/output ports are mainly used to drive/interface various devices such as LCD’S, LED’S, printers, memories, etc to a microcontroller.
Serial ports provide various serial interfaces between a microcontroller and other peripherals like parallel ports.
This is the one of the useful function of a microcontroller. A microcontroller may have more than one timer and counters. The timers and counters provide all timing and counting functions inside the microcontroller. The major operations of this section are performed clock functions, modulations, pulse generations, frequency measuring, making oscillations, etc. This also can be used for counting external pulses.
Analog to Digital Converter (ADC)
ADC converters are used for converting the analog signal to digital form. The input signal in this converter should be in analog form (e.g. sensor output) and the output from this unit is in digital form. The digital output can be used for various digital applications (e.g. measurement devices).
Digital to Analog Converter (DAC)
DAC perform reversal operation of ADC conversion.DAC converts the digital signal into analog format. It usually used for controlling analog devices like DC motors, various drives, etc.
The interrupt control used for providing interrupt (delay) for a working program. The interrupt may be external (activated by using interrupt pin) or internal (by using interrupt instruction during programming).
Special functioning block
Some microcontrollers used only for some special applications (e.g. space systems and robotics) these controllers containing additional ports to perform such special operations. This considered as special functioning block.
Comparison between Microprocessor and Microcontroller
The main comparison between microprocessor and microcontroller shown in fig (1.2)
|It is only a general purpose computer CPU
|It is a microcomputer itself
|Memory, I/O ports, timers, interrupts are not available inside the chip
|All are integrated inside the microcontroller chip
|This must have many additional digital components to perform its operation
|Can function as a microcomputer without any additional components.
|Systems become bulkier and expensive.
|Make the system simple, economic and compact
|Not capable for handling Boolean functions
|Handling Boolean functions
|Higher accessing time required
|Low accessing time
|Very few pins are programmable
|Most of the pins are programmable
|Very few number of bit handling instructions
|Many bit handling instructions
|Widely Used in modern PC and laptops
|widely in small control systems
|INTEL 8086,INTEL Pentium series
Advantages of Microcontrollers
The main advantages of microcontrollers are given.
a) Microcontrollers act as a microcomputer without any digital parts.
b) As the higher integration inside microcontroller reduces cost and size of the system.
c) Usage of a microcontroller is simple, easy to troubleshoot and system maintaining.
d) Most of the pins are programmable by the user for performing different functions.
e) Easily interface additional RAM, ROM,I/O ports.
f) Low time required for performing operations.
Disadvantages of Microcontrollers
a) Microcontrollers have got more complex architecture than that of microprocessors.
b) Only perform a limited number of executions simultaneously.
c) Mostly used in micro-equipments.
d) Cannot interface high power devices directly.
You can find microcontrollers in all kinds of electronic devices these days. Any device that measures, stores, controls, calculates, or displays information must have a microcontroller chip inside. The largest single use for microcontrollers is in the automobile industry (microcontrollers widely used for controlling engines and power controls in automobiles). You can also find microcontrollers inside keyboards, mouse, modems, printers, and other peripherals. In test equipment, microcontrollers make it easy to add features such as the ability to store measurements, to create and store user routines, and to display messages and waveforms. Consumer products that use microcontrollers include digital camcorders, optical players, LCD/LED display units, etc. And these are just a few examples.
Some basic applications of a microcontroller are given below.
a) Used in biomedical instruments.
b) Widely used in communication systems.
c) Used as a peripheral controller in PC.
d) Used in robotics.
e) Used in automobile fields.
Articles We Recommend you to read:
1. Basic of PIC