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

4_8051_Microcontroller_Tutorial_and_Architecture_with_Applications

The document provides an in-depth overview of the 8051 microcontroller, including its architecture, features, and applications. It compares microcontrollers to microprocessors, highlighting their differences in design and functionality, and discusses the selection criteria for microcontrollers. Additionally, it covers the components and pin configuration of the 8051, along with its advantages and disadvantages.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

4_8051_Microcontroller_Tutorial_and_Architecture_with_Applications

The document provides an in-depth overview of the 8051 microcontroller, including its architecture, features, and applications. It compares microcontrollers to microprocessors, highlighting their differences in design and functionality, and discusses the selection criteria for microcontrollers. Additionally, it covers the components and pin configuration of the 8051, along with its advantages and disadvantages.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

‫بسم هللا الرمحن الرحيم‬

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller Tutorial and
Architecture with Applications

by

Dr. Ayman Mohamed

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Microprocessor V.S. Microcontroller Summery
Microprocessor Microcontroller

CPU-on-a-Chip Computer-on-a-Chip

General Purpose Task Specific

Used in Computer Systems Used in Embedded Systems


Memory and I/O components are On-chip Memory and I/O
interfaced externally. Components.
Since external components
Since On-chip components, so
interfaced, so the whole system is
system is smaller and cheaper.
larger and costly.
In Microprocessor based system, In Microcontroller based system,
Instruction and data are stored in program memory and data memory
same memory module. are separate.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Microprocessor V.S. Microcontroller
Microprocessor Microcontroller
Microprocessor contains ALU, Microcontroller contains the
General purpose microprocessor, and in addition it
registers, stack pointer, program has built in
counter, clock timing circuit, ROM, RAM, I/O Devices,
interrupt circuit Timers/Counters etc.
It has many instructions to move It has few instructions to move data
data between memory and CPU between memory and CPU
It has Few bit handling instruction It has many bit handling instructions
Less number of pins are More number of pins are
multifunctional multifunctional
Single memory map for data and Separate memory map for data and
code (program) code (program)

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Microprocessor V.S. Microcontroller
Microprocessor Microcontroller
Access time for memory and IO are Less access time for built in memory
more and IO.
Microprocessor based system
It requires less additional hardware
requires additional hardware.
Less flexible since the additional
More flexible in the design point of circuits which is residing inside the
view. microcontroller is fixed for a
particular microcontroller.
Large number of instructions with Limited number of instructions
flexible addressing modes. with few addressing modes.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Microprocessor V.S. Microcontroller

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Embedded System:

 The Embedded system means that the application and the processor are
combined into a single system.
An embedded product uses a microprocessor or microcontroller to do
one task only
 There is only one application software that is typically burned into
ROM
Examples of Embedded Systems
Keyboard (home) appliances

Printer Mobile phone


video game player Embedded memories to keep
configuration information
MP3 music players Automotive controls
Data switches

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Examples of Embedded Systems

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Microcontroller Selection Criteria
 Meeting the computing needs of task at hand efficiently and cost
effectively:
 Meet the task at Hand efficiently and cost effectively.
 Speed of operation
 Packing that is important in space….
 Power consumption
 Amount of RAM and ROM on chip
 No. of I/O pins and timers on chip
 Cost per unit
 Easy to upgrade.
 How it is easy in development.
 Availability in needed quantities.
 Availability of software development tools such as compiler,
assembler and debugger.
 Wide availability and reliable sources of the microcontrollers

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller
 The 8051 Microcontroller was designed in 1981 by Intel.
 There are two buses in 8051 Microcontroller one for program and other for
data.
 The microcontroller comprise of 8 bit accumulator & 8 bit processing unit.
 For internal functioning & processing Microcontroller 8051 comes with
integrated built-in RAM. This is prime memory and is employed for storing
temporary data. It is volatile memory i.e. its data can get be lost when the
power supply to the Microcontroller switched OFF.
 There are many applications with 8051 microcontroller. So, 8051
Microcontroller Projects have great significance in Engineering final year.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller Features:
 It consists of 8 bit B register as majorly functioning blocks and 8051
microcontroller programming is done with embedded C or Assembly.
 It consists of 8 bit ALU with associated registers like accumulator ‘A’ ,
B register, 8 Bit PSW, 16 bit program counter, stack pointer, SP.
 On chip clock oscillator: used to generate clock pulses.
 Two 16 Bit Timer/Counter :T0, T1
 Full Duplex serial data receiver/transmitter
 Four Register banks with 8 registers in each bank.
 16 bit Program counter (PC) and a data pointer (DPTR).
 8 Bit Program Status Word (PSW).
 8 Bit Stack Pointer.
 Five interrupt structure (2 external , 3 internal)
 Also …..

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Basic Features (Summery)
 4K bytes internal ROM, program memory
(code memory). CPU RAM ROM

 128 bytes internal RAM for Data. I/O Serial


Timer COM
 Four 8-bit I/O ports (P0 - P3) or 32 Port
Port
individually addressable I/O lines
 Two 16-bit timers/counters
 One serial interface A single chip
Microcontroller
 64 K bytes of external program memory
address space.
 64 Kbytes of external data memory address
space.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller Block diagram
External Interrupts

Interrupt 4k 128 bytes Timer 1


Control ROM RAM Timer 2

CPU

OSC Bus
4 I/O Ports Serial
Control

P0 P2 P1 P3 TXD RXD
Addr/Data

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller Block Diagram

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller Architecture

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller Block Diagram Components
 Central Processor Unit (CPU)
 Memory
 Bus
• Address Bus
• Data Bus
 Oscillator
 Interrupts
 I/O ports

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: CPU (Central Processor Unit)
 Central Processor Unit (CPU) is the mind of any processing machine.

 It manages all processes that are carried out in the Microcontroller.

 User has no power over the functioning of CPU.

 It interprets program printed in storage space (ROM) and carries out all of them
and do the projected duty.

 CPU manages different types of registers in 8051 microcontroller.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller : Code Memory
 Micro-controller needs a program which is a set of commands.

 This program enlightens Microcontroller to perform precise tasks.

 These programs need a storage space.

 The memory program of Microcontroller is recognized as Program memory or


code memory.

 In common language it’s also known as Read Only Memory or ROM.

 IT contains code memory or program memory 4K. If the program size is more
than 4 K Bytes 8051 will fetch the code automatically from external memory.

 The address space is from 0000 to 0FFFh.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: Data Memory
 Microcontroller also needs a memory to data or operands for the short term.

 The storage space which is employed to temporary data storage for functioning.

 It is acknowledged as Data Memory and we employ Random Access Memory or


RAM for this principle reason.

 It has data memory (RAM) of 128 bytes.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: System Bus
Bus
 Bus is a group of wires which functions as a communication canal to transfer data.
 These buses comprise of 8, 16 or more cables. A bus can be 8 bits, 16 bits all
together.

Address Bus:
• Microcontroller 8051 consists of 16 bit address bus.
• It utilized to transmit the address from CPU to Memory.

Data Bus:
• Microcontroller 8051 comprise of 8 bits data bus. It is employed to transfer data.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: Oscillator
 Microcontroller is a digital circuit piece and it needs
timer for its function.
 For this function, Microcontroller 8051 consists of an
on-chip oscillator
 only 1 chip oscillator.
 It functions as a time source for Central Processing
Unit .
 The productivity pulses of oscillator are steady
 it facilitates harmonized employment of all pieces of
8051 Microcontroller.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: Interrupts
 An interrupt is a hardware mechanism used to
notify a processor that an ‘event’ has taken place:
such events may be ‘internal’ events (such as the
overflow of a timer) or ‘external’ events (such as
the arrival of a character through a serial
interface).
 interrupts provide a mechanism for creating
multitasking applications: that is applications
which perform more than one task at a time using
a single processor.
 Interrupt is a sub-routine call that reads the
Microcontroller’s key function or job. Interrupts
provides us a method to postpone or delay the
current process.
 It helps it to perform some other program which
is extra important at that point of time.
 It can Handles up to 6 Sources.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: Input/output Port:
 Much of the activity in embedded systems involves reading pins
(which may, for example, be connected to switches or keypads) and
altering the value of other pins (which may, in turn, control anything,
from an LED to a 5-tonne industrial robot).

 Most 8051s have four 8-bit ports, giving a total of 32 pins you can
individually read from or control.

 All of the ports are bidirectional: that is, they may be used for both
input and output.

 The Microcontroller is employed in embedded systems to manage the


functions of devices.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller: Timer/Counter:
 All members of the 8051 family have at least two timer/counters,
known as Timer 0 and Timer 1.
 These are 16-bit timers, which means they can hold values from 0 to
65535 (decimal).
 The timers are incremented every 12 oscillator cycles. Thus,
assuming we have a 12 MHz oscillator, the timer will be
incremented 1 million times per second.
 There are many things we can do with such a timer:
• We can use it to measure intervals of time. For example, we can
measure the duration of a function by noting the value of a timer at
the beginning and end of the function call, and comparing the two
results.
• We can use it to generate precise hardware delays.
• We can use it to generate ‘time out’ facilities: this is a key
requirement in systems with real-time constraints.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller
Explanation 805 Microcontroller Pin
 We are taking into deliberation a 40 pin Dual inline package (DIP). Now
let’s study through pin configuration in brief:
• Pins 1 – 8
• Pin 9
• Pins 10 – 17
• Pins 18 and 19
• Pin 20
• Pins- 21-28
• Pin- 29
• Pin-30
• Pin-31
• Pins 32-39
• Pin-40

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller PINS

Pins 1 – 8:-

 Recognized as Port 1. Different from other ports, this port


doesn’t provide any other purpose.
 Port 1 is a domestically pulled up, bi directional Input/output
port.
Pin 9:-

 RESET pin is utilized to set the micro-controller 8051 to its


primary values.
 The micro-controller is functioning or at the early beginning of
application.
 The RESET pin has to be set elevated for two machine rotations.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller PINS
Pins 10 – 17:-

 It recognized as Port 3.
 This port also supplies a number of other functions such as timer
input, interrupts, serial communication indicators TxD & RxD,
control indicators for outside memory interfacing WR & RD.
 This is a domestic pull up port with quasi bi directional port
within.

Pins 18 and 19:-

 These are employed for interfacing an outer crystal to give system


clock.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller PINS
Pin 20:-

 Titled as Vss – it symbolizes ground (0 V) association.

Pins- 21-28:-

 Recognized as Port 2 (P 2.0 – P 2.7) other than serving as


Input/output port.

 Senior order address bus indicators are multiplexed with this quasi
bi directional port.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller PINS
Pin- 29:-

 Program Store Enable or PSEN is employed to interpret sign from


outer program memory.

Pin-30:-

 External Access or EA input is employed to permit or prohibit


outer memory interfacing.

 If there is no outer memory need, this pin is dragged high by


linking it to Vcc.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller PINS
Pin-31:-

 It is called Address Latch Enable or ALE

 ALE is brought into play to de-multiplex the address data


indication of port 0 (for outer memory interfacing).

 Two ALE pules are obtainable for every machine rotation.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


8051 Microcontroller PINS
Pins 32-39:-
 It recognized as Port 0 (P0.0 to P0.7) – other than serving as
Input/output port.

 It low order data & address bus signals are multiplexed with this port.

 This pin is a bi directional Input/output port (the single one in


microcontroller 8051).

 Outer pull up resistors are necessary to utilize this port as


Input/output.
Pin-40:-
 Termed as Vcc is the chief power supply. By and large it is +5V DC.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Advantage of Microcontroller

 Microcontrollers act as a microcomputer without any digital parts.

 As the higher integration inside microcontroller reduce cost and size


of the system.

 Usage of microcontroller is simple, easy for troubleshoot and


system maintaining.

 Most of the pins are programmable by the user for performing


different functions.

 Easily interface additional RAM, ROM,I/O ports.

 Low time required for performing operations.

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Disadvantage of Microcontroller
 Microcontrollers have got more complex architecture than that of
microprocessors.

 Only perform limited number of executions simultaneously.

 Mostly used in micro-equipments.

 Cannot interface high power devices directly.

 Development Time due to complexity of the circuit

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Applications of 8051 Microcontroller:

 The microcontroller 8051 applications include large amount of


machines, principally because it is simple to incorporate in a project
or to assemble a machine around it. The following are the key spots
of spotlight.
1. Energy Management
2. Touch screens
3. Automobiles
4. Medical Devices
……

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Projects:

Each 4 Students need to select Project from now

http://www.elprocus.com/
https://electronicsforu.com
https://www.electronicshub.org
https://circuitdigest.com
https://www.edaboard.com/
https://www.engineersgarage.com
https://www.electronicshub.org

Introduction to Microcontroller ( Lecture 4 : 8051 MC)


Introduction to Microcontroller ( Lecture 4 : 8051 MC)
Questions?

Introduction to Microcontroller ( Lecture 4 : 8051 MC)

You might also like