MICROCONTROLLER
MICROCONTROLLER
There are some important features of microcontroller which are given below,
Microprocessor Microcontroller
It does not have inbuilt memory RAM It has inbuilt memory RAM and
and ROM. ROM.
It is used only one memory for data and It uses separate memory for data
program. and program.
The power consumption is high due to The total power consumption is low
external components. due to external component is less.
Cost of the entire system is high as The cost of the entire system is low
compared to microcontroller. as compared to microprocessor.
It is widely used in personal computers It is widely used in MP3 player,
(PC). washing machine and etc.
Pins 1 to 8 − These pins are known as Port 1. This port doesn’t serve any other functions.
It is internally pulled up, bi-directional I/O port.
Pin 9 − It is a RESET pin, which is used to reset the microcontroller to its initial values.
Pins 10 to 17 − These pins are known as Port 3. This port serves some functions like
interrupts, timer input, control signals, serial communication signals RxD and TxD, etc.
Pins 18 & 19 − These pins are used for interfacing an external crystal to get the system
clock.
Pin 20 − This pin provides the power supply to the circuit.
Pins 21 to 28 − These pins are known as Port 2. It serves as I/O port. Higher order
address bus signals are also multiplexed using this port.
Pin 29 − This is PSEN pin which stands for Program Store Enable. It is used to read a
signal from the external program memory.
Pin 30 − This is EA pin which stands for External Access input. It is used to
enable/disable the external memory interfacing.
Pin 31 − This is ALE pin which stands for Address Latch Enable. It is used to
demultiplex the address-data signal of port.
Pins 32 to 39 − These pins are known as Port 0. It serves as I/O port. Lower order
address and data bus signals are multiplexed using this port.
Pin 40 − This pin is used to provide power supply to the circuit.
QUES -ARCHITECTURE OF 8051 :
In the following diagram, the system bus connects all the support devices to the CPU. The
system bus consists of an 8-bit data bus, a 16-bit address bus and bus control signals. All other
devices like program memory, ports, data memory, serial interface, interrupt control, timers, and
the CPU are all interfaced together through the system bus.
CPU (Central Processing Unit): CPU act as a mind of any processing machine. It synchronizes
and manages all processes that are carried out in microcontroller. User has no power to control
the functioning of CPU. It interprets the program stored in ROM and carries out from storage
and then performs it projected duty. CPU manage the different types of registers available in
8051 microcontroller.
Interrupts: Interrupts is a sub-routine call that given by the microcontroller when some other
program with high priority is request for acquiring the system buses the n interrupts occur in
current running program.
Interrupts provide a method to postpone or delay the current process, performs a sub-routine task
and then restart the standard program again.
Memory: For operation Micro-controller required a program. This program guides the
microcontroller to perform the specific tasks. This program installed in microcontroller required
some on chip memory for the storage of the program.
Microcontroller also required memory for storage of data and operands for the short duration. In
microcontroller 8051 there is code or program memory of 4 KB that is it has 4 KB ROM and it
also comprise of data memory (RAM) of 128 bytes.
Bus : Bus is a group of wires which uses as a communication canal or acts as means of data
transfer. The different bus configuration includes 8, 16 or more cables. Therefore, a bus can bear
8 bits, 16 bits all together.
Oscillator: As the microcontroller is digital circuit therefore it needs timer for their operation.
To perform timer operation inside microcontroller it required externally connected or on-chip
oscillator. Microcontroller is used inside an embedded system for managing the function of
devices. Therefore, 8051 uses the two 16 bit counters and timers. For the operation of this timers
and counters the oscillator is used inside microcontroller.
QUES - Interrupts:
Interrupts is a sub-routine call that given by the microcontroller when some other program with
high priority is request for acquiring the system buses the n interrupts occur in current running
program.
Interrupts provide a method to postpone or delay the current process, performs a sub-routine task
and then restart the standard program again.
As already mentioned, Data Memory is used for temporarily storing data and intermediate results
created and used during the operation of the microcontroller. Besides, RAM memory built in the
8051 family includes many registers such as hardware counters and timers, input/output ports,
serial data buffers etc.
The previous models had 256 RAM locations, while for the later models this number was
incremented by additional 128 registers. However, the first 256 memory locations (addresses 00-
FFH) are the heart of memory common to all the models belonging to the 8051 family.
Locations available to the user occupy memory space with addresses 00-7Fh, i.e. first 128
registers. This part of RAM is divided in several blocks.
The first block consists of 4 banks each including 8 registers denoted by R0-R7. The PSW has
two bits for identifying the register bank, i.e., 00 represents bank 0, 01 represents bank 1, 10
represents bank 2, and 11 represents bank 3.
SFR, which occupies upper 128 bytes of internal memory are the registers, that control
the entire processor
They can be accessed by DIRECT addressing.
The registers available in the 8051 are as follows:
1. Accumulators – A and B
2. Process Status Word – PSW
3. I/O port registers – P0, P1, P2, P3
4. Data pointers – DPH and DPL
5. Serial data buffer register – SBUF
6. Stack pointer – SP
7. Timer registers – TH0, TH1 and TL0, TL1
8. Timer Control Registers – TCON, TMOD
9. Power and Port control – PCON, SCON
10. Interrupt Control Registers – IP, IE.
An additional memory block of 128 locations is added into the latest versions of the 8051
microcontrollers. The problem is that electronics performing addressing has 1 byte (8 bits)
on disposal and is capable of reaching only the first 256 locations, therefore.
In order to keep already existing 8-bit architecture and compatibility with other existing
models a small trick was done. It means that additional memory block shares the same
addresses with locations intended for the SFRs (80H- FFH).
In order to differentiate between these two physically separated memory spaces, different
ways of addressing are used. The SFRs memory locations are accessed by direct
addressing, while additional RAM memory locations are accessed by indirect addressing.