Difference Between Microcontroller Families
8051 - 8 bit micro based on CISC architecture ( Complex Instruction Set Computer)
PIC - 8 bit micro based on RISC architecture ( Reduced Instruction Set Computer)
AVR - 8 bit micro based on RISC architecture ( Reduced Instruction Set Computer)
there are also 16bit and 32 bit micros from the same family
invention wise, 8051 is the forefather ( date of birth = 1985), next cam PIC s and then
came the AVRs.
its essential to learn 8051 to be able to learn other micros. if we come to instruction set of
these micros :
8051 has 250 instructions which take 1 to 4 machine cycles to executive
PIC has nearly 40 instructions which are mostly 4 cycles instructions
AVRs have 140 instructions whcih are mostly 1 cycle based
if we come to speed factor:
1 machine cycle in 8051 (normal) divides the clock freq. by 12 ( some derivatives divide
by 6 and by 1 also)
1 machine cycle in PIC divides the clock freq by 4
1 M.C in AVRs divides the clock freq by 1
for eg: if we use 12 Mhz Xtal in all the 3 micros then the speed of execution will be as
follows:
8051 = 12Mhz /12 = 1 Mhz i,e = 1 million instructions per second
PIC = 12Mhz/4 = 3 Mhz i,e = 3 million instructions per second
AVR = 12Mhz/1 = 12 MHz i,e = 12 Million instructions per second
so you can clearly see the that AVR executes more no:of instructions per given time and
can be considered as the fastest among the 3.
also 8051 consumes more power than the other two and PIC consumes the least power.
Both PIC and AVR are RISC based but their instruction Sets are entirely different.
from Programming ( i,e writing code ) point of view : 8051s are easy to code , next come
PIcs and last comes AVRs.
8051 has very powerful instruction set, it has commands which do more complex
calculations, it also has got strong arithmetic logic unit which makes computation simple.
whereas PICs and AVRs have simple single instructions and the programmer has to tell
(dictate) each and every step to achieve the final outcome.
for eg:
you would be surprised to know that normal AVRs do not have Multiplication instruction.
in 8051 Assembly we can simple use the instruction : MUL A,B
but in AVR you have to write some 20 lines of code to multiply two registers or values.
similarly division also : in 8051 we have DIV A,B but in AVR again you have to write
some 20 lines of code.
There is no ADD instruction in AVRs, in 8051 we can Compliment a port bit or a bit
variable by using CPL instruction but in AVR we don't have this instruction.
in 8051 we can easily access the individual port bits but in AVRs we don't have this
freedom.
8051 is still in use bcoz of its simplicity and popularity and lowest cost.
AVRs and PICS are costly and come with many on chip peripherals like : hardware SPI,
ADC, I2C, USART , Analog comparator, internal RC oscillator, in-system
programmablity etc.
also if see vendor support: 8051 are manufactured by over 50 companies whereas PIC &
AVRs are manufactured only by their parent companies i,e microchip and Atmel.
for eg: if you are using a particular variant of AVR and Atmel discontinues it then you'll
have no other choice than to shift to another variant offered by Atmel which may be
costly and need program changes.
but with 8051 you can run the code in any 8051s manufactured by so many companies.
The term microprocessor and microcontroller have always been confused
with each other. Both of them have been designed for real time application. They
share many common features and at the same time they have significant
differences. Both the IC’s i.e., the microprocessor and microcontroller cannot be
distinguished by looking at them. They are available in different version starting
from 6 pin to as high as 80 to 100 pins or even higher depending on the features.
Difference between microprocessor and microcontroller
Microprocessor is an IC which has only the CPU inside them i.e. only the
processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo, i3, i5 etc. These
microprocessors don’t have RAM, ROM, and other peripheral on the chip. A
system designer has to add them externally to make them functional. Application
of microprocessor includes Desktop PC’s, Laptops, notepads etc.
But this is not the case with Microcontrollers. Microcontroller has a CPU, in
addition with a fixed amount of RAM, ROM and other peripherals all embedded
on a single chip. At times it is also termed as a mini computer or a computer on a
single chip. Today different manufacturers produce microcontrollers with a wide
range of features available in different versions. Some manufacturers are
ATMEL, Microchip, TI, Freescale, Philips, Motorola etc.
Microcontrollers are designed to perform specific tasks. Specific means
applications where the relationship of input and output is defined. Depending on
the input, some processing needs to be done and output is delivered. For
example, keyboards, mouse, washing machine, digicam, pendrive, remote,
microwave, cars, bikes, telephone, mobiles, watches, etc. Since the applications
are very specific, they need small resources like RAM, ROM, I/O ports etc and
hence can be embedded on a single chip. This in turn reduces the size and the
cost.
Microprocessor find applications where tasks are unspecific like developing
software, games, websites, photo editing, creating documents etc. In such cases
the relationship between input and output is not defined. They need high amount
of resources like RAM, ROM, I/O ports etc.
The clock speed of the Microprocessor is quite high as compared to the
microcontroller. Whereas the microcontrollers operate from a few MHz to 30 to
50 MHz, today’s microprocessor operate above 1GHz as they perform complex
tasks. Read more about what is microcontroller.
Comparing microcontroller and microprocessor in terms of cost is not
justified. Undoubtedly a microcontroller is far cheaper than a microprocessor.
However microcontroller cannot be used in place of microprocessor and using a
microprocessor is not advised in place of a microcontroller as it makes the
application quite costly. Microprocessor cannot be used stand alone. They need
other peripherals like RAM, ROM, buffer, I/O ports etc and hence a system
designed around a microprocessor is quite costly.