0% found this document useful (0 votes)
6 views

P

The document provides an overview of the 8051 microcontroller, designed by Intel in 1981, highlighting its architecture, features, and applications in embedded systems. It compares microcontrollers with microprocessors, detailing key differences such as power consumption, complexity, and cost-effectiveness. Additionally, it outlines criteria for selecting a microcontroller and explains the memory organization and pin configuration of the 8051 microcontroller.

Uploaded by

abishri.k2023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

P

The document provides an overview of the 8051 microcontroller, designed by Intel in 1981, highlighting its architecture, features, and applications in embedded systems. It compares microcontrollers with microprocessors, detailing key differences such as power consumption, complexity, and cost-effectiveness. Additionally, it outlines criteria for selecting a microcontroller and explains the memory organization and pin configuration of the 8051 microcontroller.

Uploaded by

abishri.k2023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Microcontroller

The microcontroller like 8051 was designed in the year 1981 by Intel.

Its foundation was on Harvard Architecture and was developed principally for bringing into play Embedded
Systems.

An Embedded system product is used to do only one task, or we can say these are the application specific
processors with memory, I/O, Timers, buses etc. on one single chip.

At first, it was created using NMOS technology but as NMOS technology needs more power to function therefore
Intel re-intended Microcontroller 8051 employing CMOS technology and a new edition came into existence with a
letter ‘C’ in the title name, for illustration: 80C51.

The most common embedded systems that we use from day to day life are Air Conditioner, Touch Screen, Anti-
Break System, Biometric Attendance System, Face Sensors etc.

2
Microprocessor Microcontroller
Key Differences Heart/Brain of the Computer System. Heart/Brain of the embedded system.

Between Externally connected with input-output


components.
input-output components are embedded.

Microprocessor and The circuit may be large depending upon

Microcontroller
The circuit is very small.
usage.

Not cost-effective. Cost-effective.

The total consumption of power is high. Total consumption of power is less.

Power saving mode is not generally


Power saving mode is generally offered.
available.

Used in MP3 players, washing machines,


Used in PC.
AC etc.

Memories like RAM and ROM are absent. Carries RAM, ROM, etc.

Runs at a very high speed. Runs at a relatively lower speed.

It is complex and costly. Simple and cheap.

Example: DEC Alpha 21164, IBM RS6000, Example: Intel 8051, PIC 16x, Zilog’s Z8,
etc. Freescale’s 6811 etc.

3
Some Embedded products using 4
Microcontroller
 Security systems  Laser printer  Garage door openers

 Fax machines  Color printer  Intercom

 Remote controls  Air bag  Air Conditioners

 Video games  ABS  Refrigerator

 Camera  Keyless entry  Telephones

 Toys  Climate control  Washing Machine

 Exercise equipment  TVs  Lighting Control

 Microwave  Biometric System  Musical Instruments


Microcontroller Companies

Company Web Site

Intel www.intel.com/design/mcs51

Atmel www.atmel.com

Philips/Signetics www.semiconductors.philips.com

Infineon www.Infineon.com

Dalla Semi/Maxim www.maxim-ic.com

Silicon Labs www.silabs.com

5
How to choose a microcontroller ?

Three criteria in Choosing a Microcontroller:


• Meeting the computing needs of the task efficiently and cost effectively
• Speed, the amount of ROM and RAM, the number of I/O ports and
timers, size, packaging, power consumption
• Easy to upgrade
• Cost per unit
• Availability of software development tools
• Assemblers, debuggers, C compilers, emulator, simulator, technical
support
• Wide availability and reliable sources of the microcontrollers.

6
The 8051 Microcontroller
A harvard Single chip
architecture (separate microcontroller (µc)
instruction/data
memories)

Developed by intel in Today largely superseded by a vast


1980 for use in range of faster and/or functionally
embedded systems. enhanced 8051-compatible devices
manufactured by more than 20
independent manufacturers

• ROM - 4K Byte
• RAM – 128 Byte
• I/O Pins – 32
• Interrupt Sources – 6
Block Diagram of 8051 • Timers – 2
• Serial port - 1
7
8051 microcontroller is designed by Intel in 1981.

It is an 8-bit microcontroller.

It is built with 40 pins DIP (dual inline package)


Main Features
of The 8051 It has 4KB of ROM storage

Microcontroller In consist of 128 bytes of RAM storage

It has two 16-bit timers

It consists of 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.

8
Comparison of the 8051 Family Members
Feature 8051 8052 8031

ROM (program space in bytes) 4K 8K 0K

RAM (bytes) 128 256 128

Timers 2 3 2

I/O pins 32 32 32

Serial port 1 1 1

Interrupt sources 6 8 6

9
Pin Diagram of
8051

8051 microcontroller is available in 40


pin Dual Inline package (DIP)

Four I/O ports (Port-1, Port-2, Port-3,


Port-4 ) w

The remaining pins are assigned to


VCC, GND, XTAL1, XTAL2, RST,
ALE, EA and PSEN here in each port
has 8 pin.

10
Explanation of the Pins
- Pin 1 to Pin 8 (Port – 1) – Pin 1 to Pin 8 is assigned to Port 1 for simple I/O
operations. It is a bidirectional port.

- Pin 9 (RST) – It is a reset input Pin, which is used to reset the 8051

- Pin 10 to Pin 17 (Port-3) – Pin 10 to Pin 17 are assigned to Port 3. This port is
also a bidirectional I/O port like port 1. This port performs some special functions
like interrupts, control signals, timer input, serial communication etc.

- Pin 18 and Pin 19 (XTAL2 And XTAL1) –Pins 18 and 19 i.e. XTAL 2 and
XTAL 1 are the pins for interfacing external oscillator. Mostly, a Quartz Crystal
Oscillator is connected here to get the system clock.

- Pin 20 (GND) – Pin 20 is the Ground Pin. It is connected to the 0V (negative


terminal) of the Power Supply.

11
Explanation of the Pins
- Pin 21 to Pin28 (Port 2) – Pin 21 to pin 28 are port 2 pins. This port is also a bidirectional I/O port. But, this
is only possible when we are not using any external memory. If we use external memory, then these pins will
work as high order address bus (A8 to A15).

- Pin 29 (PSEN) – The Pin 29 is the Program Store Enable Pin (PSEN). It is used to enable external program
memory and read a signal from the external program memory.

- Pin 30 (ALE) – Pin 30 is the Address Latch Enable Pin. This pin is used to enable or disable the external
memory interfacing.

- Pin 31 (EA) – Pin 31 is the External Access Enable (EA) Pin. This pin allows external Program Memory. It is
an input pin and connected from VCC or GND. If we want to access the program from external program
memory, it must be connected with GND. If we want to use on-chip memory, it must be high (connected with
VCC).

- Pin 32 to Pin 39 (Port 0) – Pin 32 to Pin 39 are Port 0 pins. when we don’t use any external memory, these
pins are used as a bidirectional pin like port 2 and port 3. But, when ALE or Pin 30 is at 1, then this port is
used as data bus. And when the ALE pin is at 0, then this port is used as a lower order address bus (A0 to A7).

- Pin 40 (VCC) – This pin is used to provide (+5V ) power supply to the 8051 microcontroller circuit.

12
13
- Accumulator (A register) – The Accumulator, as its name suggests, is 14
used as a general register to accumulate the results of many instructions. It
can hold an 8-bit (1-byte) value and is the most versatile register the 8051.
This register is mostly used for arithmetic operations. The accumulator
register (A or ACC) act as an operand register, in case of some
instructions.

- B register – This is an 8-bit register that is bit addressable and is used for
two instructions only like MUL AB and DIV AB.

MOV & ADD Instruction:


MOV destination, source ;copy source to dest
ADD A, Source

• MOV A,#55H
• MOV R0,A MOV A,#55H
• MOV R1,#34H
MOV R0,#46H
• MOV A,R1
• MOV R2,#20 ADD A,R0
• MOV A,R2

Module 3, Microprocessor & Microcontroller, SENSE VIT Dr. Shelja, Assistant Professor
- PSW register – Program Status Word (PSW) is the flag 15

resister in 8051. The flag bits are used to indicate the


arithmetic condition of the ACC. This register consists of
flags like Carry, Auxiliary Carry Flag, Flag 0 Register
Select 1, Register Select 0, Parity Flag, Overflow flag.

● CY, the carry flag: This flag is set whenever there is a carry out from
the D7 bit. This flag bit is affected after an 8-bit addition or subtraction.
It can also be set to 1 or 0 directly by an instruction such as “SETB C”
and “CLR C” where “SETB C” stands for “set bit carry” and “CLR C”
for “clear arry”.

● AC, the auxiliary carry flag: If there is a carry from D3 to D4


during an ADD or SUB operation, this bit is set; otherwise, it is cleared.

● P, the parity flag: The parity flag reflects the number of 1s in the A
(accumulator) register only. If the A register contains an odd number of
1s, then P = 1, Otherwise, P = 0 if A has an even number of 1s.

● OV, the overflow flag: This flag is set whenever the result of a signed
number operation is too large, causing the high-order bit to overflow
into the sign bit. In general, The overflow flag is only used to detect
errors in signed arithmetic operations.

Module 3, Microprocessor & Microcontroller, SENSE VIT


Dr. Shelja, Assistant Professor
Instructions That Affect Flag Bits

Note: X can be 0 or 1.
16
Example 1

Show the status of the CY, AC, and P flags after the addition of 38H and 2FH in the following
instructions.

MOV A,#38H
ADD A,#2FH ;after the addition A=67H, CY=0

Solution:
38 00111000
+ 2F 00101111
67 01100111

CY = 0 since there is no carry beyond the D7 bit.


AC = 1 since there is a carry from the D3 to the D4 bit.
P = 1 since the accumulator has an odd number of 1s (it has five 1s).
17
Example 2

Show the status of the CY, AC, and P flags after the addition of 9CH and 64H in the following
instructions.
MOV A,#9CH
ADD A,#64H ;after addition A=00 and CY=1

Solution:
9C 10011100
+ 64 01100100
100 00000000

CY = 1 since there is a carry beyond the D7 bit.


AC = 1 since there is a carry from the D3 to the D4 bit.
P = 0 since the accumulator has an even number of 1s (it has zero 1s).
18
19

Some 8051 16-bit Registers

- DPTR (Data Pointer)- This 16-bit register


contains a higher byte (DPH) and the lower
byte (DPL) of a 16-bit external data RAM
address

- Program Counter – is a 16 bit register that


helps to access address from 0000H to
FFFFH. Program Counter is used to address
the next instruction to be executed from the
ROM.

Module 3, Microprocessor & Microcontroller, SENSE VIT


Dr. Shelja, Assistant Professor
20

Memory Organization

The 8051 microcontroller's memory


is divided into Program Memory and
Data Memory.

Program Memory (ROM) is used for


permanent saving program being
executed.

Data Memory (RAM) is used for


temporarily storing and keeping
intermediate results and variables.
21

ROM Memory
Map in the
8051 Family
 Program Memory (ROM) is used
for permanent saving program
(CODE) being executed.
 8051 memory organization
allows external program memory
to be added. memory type How
does the microcontroller handle
external memory depends on
the pin EA logical state.

Module 3, Microprocessor & Microcontroller, SENSE VIT


Dr. Shelja, Assistant Professor
22

Data Memory -
RAM

Module 3, Microprocessor & Microcontroller, SENSE VIT


Dr. Shelja, Assistant Professor

You might also like