Over View of Microcontroller Part 1
Over View of Microcontroller Part 1
Microcontroller Microprocessor
Microcontrollers are used to execute a single task Microprocessors are used for big
within an application. applications.
Its designing and hardware cost is low. Its designing and hardware cost is
high.
It is built with CMOS technology, which requires Its power consumption is high because
less power to operate. it has to control the entire system.
It consists of CPU, RAM, ROM, I/O ports. It doesn’t consist of RAM, ROM, I/O
ports. It uses its pins to interface to
peripheral devices.
Types of Microcontrollers
Microcontrollers are divided into various categories based on memory,
architecture, bits and instruction sets. Following is the list of their types −
Bit
Based on bit configuration, the microcontroller is further divided into three categories.
8-bit microcontroller – This type of microcontroller is used to execute arithmetic
and logical operations like addition, subtraction, multiplication division, etc. For
example, Intel 8031 and 8051 are 8 bits microcontroller.
16-bit microcontroller – This type of microcontroller is used to perform
arithmetic and logical operations where higher accuracy and performance is
required. For example, Intel 8096 is a 16-bit microcontroller.
32-bit microcontroller – This type of microcontroller is generally used in
automatically controlled appliances like automatic operational machines,
medical appliances, etc.
Memory
Based on the memory configuration, the microcontroller is further divided into two
categories.
External memory microcontroller – This type of microcontroller is designed in
such a way that they do not have a program memory on the chip. Hence, it is
named as external memory microcontroller. For example: Intel 8031
microcontroller.
Embedded memory microcontroller − This type of microcontroller is designed
in such a way that the microcontroller has all programs and data memory,
counters and timers, interrupts, I/O ports are embedded on the chip. For
example: Intel 8051 microcontroller.
Instruction Set
Based on the instruction set configuration, the microcontroller is further divided into two
categories.
CISC − CISC stands for complex instruction set computer. It allows the user to
insert a single instruction as an alternative to many simple instructions.
RISC − RISC stands for Reduced Instruction Set Computers. It reduces the
operational time by shortening the clock cycle per instruction.
Applications of Microcontrollers
Microcontrollers are widely used in various different devices such as −
Light sensing and controlling devices like LED.
Temperature sensing and controlling devices like microwave oven, chimneys.
Fire detection and safety devices like Fire alarm.
Measuring devices like Volt Meter.
Overview of Microcontroller series 8051 (MCS-51)
8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller. It
is built with 40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of
RAM storage, 2 16-bit timers. It consists of are four parallel 8-bit ports, which are
programmable as well as addressable as per the requirement. An on-chip crystal
oscillator is integrated in the microcontroller having crystal frequency of 12 MHz.
Let us now discuss the architecture of 8051 Microcontroller.
Input Configuration
If any pin of this port is configured as an input, then it acts as if it “floats”, i.e. the
input has unlimited input resistance and in-determined potential.
Output Configuration
When the pin is configured as an output, then it acts as an “open drain”. By
applying logic 0 to a port bit, the appropriate pin will be connected to ground (0V), and
applying logic 1, the external output will keep on “floating”.
In order to apply logic 1 (5V) on this output pin, it is necessary to build an external pull
up resistor.
Port 1
P1 is a true I/O port as it doesn’t have any alternative functions as in P0, but this
port can be configured as general I/O only. It has a built-in pull-up resistor and is
completely compatible with TTL circuits.
Port 2
P2 is similar to P0 when the external memory is used. Pins of this port occupy
addresses intended for the external memory chip. This port can be used for higher
address byte with addresses A8-A15. When no memory is added then this port can be
used as a general input/output port similar to Port 1.
Port 3
In this port, functions are similar to other ports except that the logic 1 must be
applied to appropriate bit of the P3 register.
Memory organization:-
The internal data memory of 8051 is divided into two groups. These are a set of
eight registers and a scratch pad memory. These eight registers are R0 toR7. The
address range 00H to 07H is used to access the registers, and the rest are scratch pad
memory.
8051 Provides four register bank, but only one register bank can be used at any
point in time. To select the register bank, two bits of PSW (Program Status Word) are
used.
Stack Area
The stack area in 8051always can be implemented in the internal data memory.
Here the stack pointer (SP) is an only 8-bit register, because the internal RAM area is
only in range 00H to 7FH, and when all register banks are being used, the stack
location will be in range 30H to 7FH. So in such a case, the SP will be initialized with
2FH.
The stack pointer SP increases before each PUSH operation and decreases after each
pop instruction.
When the 8051 is reset, the Stack Pointer will point to 07H. It means the location 08H to
7FH can be used as a stack. We are assuming that the register bank 0 is in use and
20H to 27H are not like bit-addressable area.