This post is the continuation of the post INTRODUCTION TO PIC.
Microcontroller is a single chip micro computer 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).
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 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 equipments, 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.
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. Instruction fetched from program memory must be decoded by the CPU.
The function of memory in a microcontroller is same as 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
Serial ports provide various serial interfaces between 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 perform 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 use for various digital applications (e.g. measurement devices).
- Digital to Analog Converter (DAC)
DAC perform reversal operation of ADC conversion.DAC convert the digital signal into analog format. It usually used for controlling analog devices like DC motors, various drives, etc.
- Interrupt control
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)
Comparison of Micrprocessor and Microcontroller
|1||It is only a general purpose computer CPU||It is a micro computer itself|
|2||Memory, I/O ports, timers, interrupts are not available inside the chip||All are integrated inside the microcontroller chip|
|3||This must have many additional digital components to perform its operation||Can function as a micro computer without any additional components.|
|4||Systems become bulkier and expensive.||Make the system simple, economic and compact|
|5||Not capable for handling Boolean functions||Handling Boolean functions|
|6||Higher accessing time required||Low accessing time|
|7||Very few pins are programmable||Most of the pins are programmable|
|8||Very few number of bit handling instructions||Many bit handling instructions|
|9||Widely Used in modern PC and laptops||widely in small control systems|
|E.g.||INTEL 8086,INTEL Pentium series||INTEL8051,89960,PIC16F877|
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 reduce cost and size of the system.
c) Usage of microcontroller is simple, easy for 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 limited number of executions simultaneously.
c) Mostly used in micro-equipments.
d) Cannot interface high power devices directly.
Microcontrollers are widely used in modern electronics equipments. Some basic applications of microcontroller is given below.
a) Used in biomedical instruments.
b) Widely used in communication systems.
c) Used as peripheral controller in PC.
d) Used in robotics.
e) Used in automobile fields.
Articles We Reccommend you to read:
1. Basic of PIC