0% found this document useful (0 votes)
16 views33 pages

MC Module1

The document provides a detailed comparison between microprocessors and microcontrollers, highlighting the features and architecture of the 8051 microcontroller. It discusses the internal components, memory organization, and pin functions of the 8051, as well as its various types and applications. Additionally, it outlines the differences between the 8051 and its family members, emphasizing its design and operational capabilities.

Uploaded by

isaacsabu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views33 pages

MC Module1

The document provides a detailed comparison between microprocessors and microcontrollers, highlighting the features and architecture of the 8051 microcontroller. It discusses the internal components, memory organization, and pin functions of the 8051, as well as its various types and applications. Additionally, it outlines the differences between the 8051 and its family members, emphasizing its design and operational capabilities.

Uploaded by

isaacsabu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Module 1

Comparison of microprocessor and microcontroller - features of 8051 -


internal architecture – pin functions - comparison of different versions from
8031 to 8051 - data memory and program memory organization - port
architecture
• MP and MC are the part of the computing systems and input to
both the systems are digital in nature.
• Both microcontrollers and microprocessors are complex sequential
digital circuits meant to carry out job according to the program /
instructions.
Microcontroller Microprocessor
Microcontrollers are used to Microprocessors are used for big
execute a single task within an applications.
application.
Its designing and hardware cost Its designing and hardware cost is
is low. high.
Easy to replace. Not so easy to replace.
It is built with CMOS technology, Its power consumption is high
which requires less power to because it has to control the entire
operate. system.
It consists of CPU, RAM, ROM, It doesn’t consist of RAM, ROM, I/O
I/O ports. ports. It uses its pins to interface to
peripheral devices.
• Microcontrollers:
A Microcontroller is a small and low-cost chip, which is designed to perform
the specific tasks
• 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-bit
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.
8051 microcontroller:
• In 1981 INTEL introduced an 8 bit microcontroller called 8051
• This microcontroller had 128bytes of RAM ,4K bytes of on chip ROM,two
timers, one serial port and Four 8 bit I/O port all on single chip.
• 8 bit controller means it can work only 8 bits of data at a time.
Components in MC
• Bus control - data and address bus
• Four general purpose parallel input out ports
• Timers and counters
• Internal RAM and ROM
• Serial port
• Interrupt control logic
• CPU
8051 architecture
• CPU-It monitors and controls all operations that are performed on the
Microcontroller units. It reads program written in ROM memory and
executes them and do the expected task of that application.
• INTERRUPT CONTROL-Interrupt is a subroutine call that interrupts of the
microcontrollers main operations or work and causes it to execute any
other program, which is more important at the time of operation. The
feature of Interrupt is very useful as it helps in case of emergency
operations
Internal RAM and ROM
The memory which is used to store the program of the microcontroller is
known as code memory or Program memory of applications. It is known as
ROM .Memory of microcontroller also requires a memory to store data or
operands temporarily of the micro controller. The data memory of the 8051 is
used to store data temporarily for operation is known RAM memory. 8051
microcontroller has 4K of code memory or program memory, that has 4KB
ROM and also 128 bytes of data memory of RAM.
Program memory-ROM
Storing data temporarily-RAM
• ROM permanent storage ,non volatile
• Code of 4K memory is present on chip ROM
• RAM: volatile
• 128 bytes of internal memory
BUS
• Basically Bus is a collection of wires which work as a communication
channel or medium for transfer of Data.
• Two types of Buses
▪ Address Bus
▪ Data Bus
• Address Bus: Microcontroller 8051 has a 16 bit address bus for
transferring the data. It is used to address memory locations and to
transfer the address from CPU to Memory of the microcontroller.
• Data Bus: Microcontroller 8051 has 8 bits of the data bus, which is used
to carry data of particular applications.
oscillators
• the microcontroller is a device, therefore it requires clock pulses for its
operation of microcontroller applications. For this purpose,
microcontroller 8051 has an on-chip oscillator which works as a clock
source for Central Processing Unit of the microcontroller.
Input/output Port
• To connect it to other machines, devices or peripherals we require I/O
interfacing ports in the microcontroller interface. For this purpose
microcontroller 8051 has 4 input, output ports to connect it to the other
peripherals
4 general purpose parallel I/O ports:
• Port 0,port 1,port2,port3
• All ports are 8 bit
Timers/Counters
• 8051 microcontroller has two 16 bit timers and counters. Their main
purpose is to measure time and count external events. The internal
operations can be synchronized using timers and counters
Timers and counters
• Internal operations can be synchronized using clock circuit
• 2 pins –XTAL1 and XTAL 2
• 4 additional pins
✓ EA-external enable
✓ PSEN-program status enable
✓ ALE-address latch enable
✓ RST-Reset
Features of 8051
• 8051 microcontroller is designed by Intel in 1981
• It is built with 40 pins
• Useful for small computing tasks
• Less power consumption
• 4K bytes ROM
• 128 bytes RAM
• Four 8 bit I/O port
• Two 8/16 bit timers
• Multiple internal and external interrupt sources
• 1 serial port
• An on-chip crystal oscillator is integrated in the microcontroller
Comparison of 8051 family members
• Pins 1 to 8 − These pins are known as Port 1. It is an 8
bit 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 ALE pin which stands for Address Latch
Enable. It is used to demultiplex the address-data signal
of port.
• Pin 31-This is EA pin which stands for External Access
input. It is used to enable/disable the external memory
interfacing.
• 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
PORT 3 Pin Function Description
P3.0 RXD Serial Input
P3.1 TXD Serial Output
P3.2 INT0 External Interrupt 0
P3.3 INT1 External Interrupt 1
P3.4 T0 Timer 0
P3.5 T1 Timer 1
P3.6 WR External Memory Write
P3.7 RD External Memory Read
• 8051 Microcontroller Memory Organization
• The 8051 Microcontroller Memory is separated in Program
Memory (ROM) and Data Memory (RAM). The Program
Memory of the 8051 Microcontroller is used for storing the
program to be executed i.e. instructions. The Data Memory on
the other hand, is used for storing temporary variable data
and intermediate results.
• 8051 Microcontroller has both Internal ROM and Internal
RAM. If the internal memory is inadequate, we can add
external memory using suitable circuits
• Program Memory (ROM) of 8051 Microcontroller
• In 8051 Microcontroller, the code or instructions to be executed are
stored in the Program Memory, which is also called as the ROM of
the Microcontroller. The original 8051 Microcontroller by Intel has
4KB of internal ROM.
• Some variants of 8051 like the 8031 and 8032 series doesn’t have
any internal ROM (Program Memory) and must be interfaced with
external Program Memory with instructions loaded in it.
• In case of 4KB of Internal ROM, the address space is 0000H to 0FFFH. If the address space i.e.
the program addresses exceed this value, then the CPU will automatically fetch the code from
the external Program Memory.
• For this, the External Access Pin (EA Pin) must be pulled HIGH i.e. when the EA Pin is high, the
CPU first fetches instructions from the Internal Program Memory in the address range of
0000H to 0FFFH and if the memory addresses exceed the limit, then the instructions are

fetched from the external ROM in the address range of 1000H to FFFFH .
• There is another way to fetch the instructions: ignore the Internal ROM
and fetch all the instructions only from the External Program Memory
(External ROM). For this scenario, the EA Pin must be connected to GND.
In this case, the memory addresses of the external ROM will be from
0000H to FFFFH.
Bytes Hex Address range

16 10 0-F

256 100 0 - FF

1K 400 0 - 3FF

4K 1000 0 - FFF

64K 10000 0 - FFFF

1M 100000 0 - FFFFF

16M 1000000 0 - FFFFFF


Data memory organization in 8051-RAM
• Size of RAM-128bytes
• Decimal values is 0 to 127
• Hexadecimal representation is 00H to 07FH

07FH

00H
• Register banks will select based on the register select bits on the
PSW
• To store a single bit of data we can utilize the bit addressable state.
Here each bit is addressable.
• General purpose RAM is used for general access for storing small
data for fast retrieval
• 8051 Also provide stack memory with SP address Starts from 07H
• By default all the general purpose register function we will use bank
0 only because always the status of RS0 and RS1 is 0.
8051 port architecture:
• 8051 has 32 I/O pins configured as four 8 bit parallel ports. All 4 ports are bidirectional

• Each port has a special function register of 8 bit size which is used to configure the port as
input or output port.

• The registers are designed as P0,P1,P2 and P3.Each register consist of 8 D latches
• To make a port as input port, write 1’s to all bits of corresponding register. To make a port as
output port, write 0’s to all bits of corresponding register

• Each port consist of a latch, buffer and output drivers


Port 0 architecture:
• Acts as general purpose I/O port

• If external memory is present, then it act as bidirectional multiplexed address/Data bus

• That is port 0 performs dual role.


• To use as input port a one must be written into the port0 latch .Thus turning both the output
transistor OFF.

• Which in turn cause the pin to be connected to the input buffer


Port 1 Architecture

• Performs only I/O operation

• It does not perform dual function

• The output of the latch is directly connected to the FET


Port 2 Architecture
• Similar to port 0

• Port 2 may be used as input port ,output port or to supply higher order address byte (with
the presence of external memory)
Port 3 Architecture:
• It behaves as a dedicated I/O ports

• The alternate function of port 3 is to transmit and receive serial data

• This can be done using an extra buffer and a NAND gate circuit

You might also like