SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
Introduction to Microcontroller
and 8051 Architecture
Prof. Anish Goel
Embedded Systems
Micro Controller
 A micro controller is an integrated circuit or a chip
with a processor and other support devices like program
memory, data memory, I/O ports, serial communication
interface etc integrated together.
 Unlike a microprocessor (ex: Intel 8085), a
microcontroller does not require any external interfacing
of support devices.
 Intel 8051 is the most popular microcontroller ever
produced in the world market.
2 Embedded Systems Prof.Anish Goel
Microprocessor vs Microcontroller
3 Embedded Systems Prof.Anish Goel
8051 Pin Diagram & Description
4 Embedded Systems Prof.Anish Goel
Description
 Pin-40 : Named asVcc is the main power source. Usually its +5V DC.
 Pins 32-39: Known as Port 0 (P0.0 to P0.7) – In addition to serving as I/O
port,lower order address and data bus signals are multiplexed with this
port (to serve the purpose of external memory interfacing).This is a bi
directional I/O port (the only one in 8051) and external pull up resistors
are required to function this port as I/O.
 Pin-31:-ALE aka Address Latch Enable is used to demultiplex the address-
data signal of port 0 (for external memory interfacing.) 2 ALE pulses are
available for each machine cycle.
 Pin-30:- EA/ External Access input is used to enable or disallow external
memory interfacing. If there is no external memory requirement, this pin is
pulled high by connecting it toVcc.
 Pin- 29:- PSEN or Program Store Enable is used to read signal from
external program memory.
 Pins- 21-28:- Known as Port 2 (P 2.0 to P 2.7) – in addition to serving as
I/O port, higher order address bus signals are multiplexed with this quasi bi
directional port.
 Pin 20:- Named asVss – it represents ground (0V) connection.
5 Embedded Systems Prof.Anish Goel
Description
 Pins 18 and 19:- Used for interfacing an external crystal to
provide system clock.
 Pins 10 – 17:- Known as Port 3.This port also serves some
other functions like interrupts, timer input, control signals for
external memory interfacing RD andWR , serial
communication signals RxD and TxD etc.This is a quasi bi
directional port with internal pull up.
 Pin 9:- As explained before RESET pin is used to set the 8051
microcontroller to its initial values, while the microcontroller
is working or at the initial start of application.The RESET pin
must be set high for 2 machine cycles.
 Pins 1 – 8:- Known as Port 1. Unlike other ports, this port
does not serve any other functions. Port 1 is an internally
pulled up, quasi bi directional I/O port.
6 Embedded Systems Prof.Anish Goel
8051 Internal Architecture
7 Embedded Systems Prof.Anish Goel
8051 Microcontroller Block Diagram
8 Embedded Systems Prof.Anish Goel
ALU
 All arithmetic and logical functions are carried out by the
ALU.
Addition, subtraction with carry, and multiplication come
under arithmetic operations.
Logical AND, OR and exclusive OR (XOR) come under
logical operations.
9 Embedded Systems Prof.Anish Goel
Program Counter (PC)
 A program counter is a 16-bit register and it has no
internal address.The basic function of program counter is
to fetch from memory the address of the next instruction
to be executed.The PC holds the address of the next
instruction residing in memory and when a command is
encountered, it produces that instruction.This way the
PC increments automatically, holding the address of the
next instruction.
10 Embedded Systems Prof.Anish Goel
Registers
 Registers are usually known as data storage devices. 8051
microcontroller has 2 registers, namely Register A and
Register B. Register A serves as an accumulator while Register
B functions as a general purpose register.These registers are
used to store the output of mathematical and logical
instructions.
The operations of addition, subtraction, multiplication and
division are carried out by Register A. Register B is usually
unused and comes into picture only when multiplication and
division functions are carried out by Register A.
 Register A also involved in data
transfers between the microcontroller and
external memory.
11 Embedded Systems Prof.Anish Goel
Special Function Registers
 8051 microcontroller also has 7 Special Function
Registers (SFRs).They are:
 1. Serial Port Data Buffer (SBUF)
2.Timer/Counter Control (TCON)
3.Timer/Counter Mode Control (TMOD)
4. Serial Port Control (SCON)
5. Power Control (PCON)
6. Interrupt Priority (IP)
7. Interrupt Enable Control (IE)
12 Embedded Systems Prof.Anish Goel
Timers and Counters
 Synchronization among internal operations can be achieved with the help
of clock circuits which are responsible for generating clock pulses. During
each clock pulse a particular operation will be carried out, thereby, assuring
synchronization among operations. For the formation of an oscillator, we
are provided with two pins XTAL1 and XTAL2 which are used for
connecting a resonant network in 8051 microcontroller device. In addition
to this, circuit also consists of four more pins.They are,
Internal operations can be synchronized using clock circuits which produce
clock pulses.With each clock pulse, a particular function will be
accomplished and hence synchronization is achieved.There are two pins
XTAL1 and XTAL2 which form an oscillator circuit which connect to a
resonant network in the microcontroller.The circuit also has 4 additional
pins -
1. EA: External enable
2.ALE:Address latch enable
3. PSEN: Program store enable and
4. RST: Reset.
13 Embedded Systems Prof.Anish Goel
Internal RAM and ROM
 ROM
 A code of 4K memory is incorporated as on-chip ROM in
8051.The 8051 ROM is a non-volatile memory meaning that
its contents cannot be altered and hence has a similar range of
data and program memory, i.e, they can address program
memory as well as a 64K separate block of data memory.
RAM
 The 8051 microcontroller is composed of 128 bytes of
internal RAM.This is a volatile memory since its contents will
be lost if power is switched off.These 128 bytes of internal
RAM are divided into 32 working registers
which in turn constitute 4 register banks
(Bank 0-Bank 3) with each bank consisting
of 8 registers (R0 - R7).There are 128
addressable bits in the internal RAM.
14 Embedded Systems Prof.Anish Goel
Memory Mapping of 8051
15 Embedded Systems Prof.Anish Goel
Four General Purpose Parallel
Input/Output Ports
 The 8051 microcontroller has four 8-bit input/output ports.These are:
PORT P0:When there is no external memory present, this port acts as a
general purpose input/output port. In the presence of external memory, it
functions as a multiplexed address and data bus. It performs a dual role.
PORT P1:This port is used for various interfacing activities.This 8-bit port
is a normal I/O port i.e. it does not perform dual functions.
PORT P2: Similar to PORT P0, this port can
be used as a general purpose port when there is
no external memory but when external memory
is present it works in conjunction with PORT PO
as an address bus.This is an 8-bit port and
performs dual functions.
PORT P3: PORT P3 behaves as a dedicated I/O port
16 Embedded Systems Prof.Anish Goel
Interrupt Control
 An event which is used to suspend or halt the normal program
execution for a temporary period of time in order to serve
the request of another program or hardware device is called
an interrupt.An interrupt can either be an internal or external
event which suspends the microcontroller for a while and
thereby obstructs the sequential flow of a program.
There are two ways of giving interrupts to a microcontroller –
one is by sending software instructions and the other is by
sending hardware signals.The interrupt mechanism keeps the
normal program execution in a "put on hold" mode and
executes a subroutine program and after the subroutine is
executed, it gets back to its normal program execution.This
subroutine program is also called an interrupt handler.A
subroutine is executed when a certain event occurs.
17 Embedded Systems Prof.Anish Goel
Interrupt
 In 8051, 5 sources of interrupts are provided.They are:
a) 2 external interrupt sources connected through INT0
and INT1
b) 3 external interrupt sources- serial port interrupt,
Timer Flag 0 and Timer Flag 1.
18 Embedded Systems Prof.Anish Goel
Serial Data Communication
 A method of establishing communication among computers is
by transmitting and receiving data bits is a serial connection
network. In 8051, the SBUF (Serial Port Data Buffer) register
holds the data; the SCON (Serial Control) register manages
the data communication and the PCON (Power Control)
register manages the data transfer rates. Further, two pins -
RXD andTXD, establish the serial network.
 The SBUF register has 2 parts –
one for storing the data to be
transmitted and another for
receiving data from outer sources.
The first function is done using TXD
pin and the second function is done using RXD pin.
19 Embedded Systems Prof.Anish Goel
PSW
 Program StatusWord or PSW is a hardware register which is a
memory location which holds a program's information and also
monitors the status of the program this is currently being executed.
PSW also has a pointer which points towards the address of the
next instruction to be executed. PSW register has 3 fields namely
are instruction address field, condition code field and error status
field.We can say that PSW is an internal register that keeps track of
the computer at every instant.
 Generally, the instruction of
the result of a program is stored
in a single bit register called a 'flag'.
The are7 flags in the PSW of 8051.
Among these 7 flags, 4 are math flags
and 3 are general purpose or user flags.
20 Embedded Systems Prof.Anish Goel
Flags
 The 4 Math flags are:
• Carry (c)
• Auxiliary carry (AC)
• Overflow (OV)
• Parity (P)
The 3 General purpose flags or User flags are:
• FO
• GFO
• GF 1
21 Embedded Systems Prof.Anish Goel
Data Pointer (DPTR)
 The data pointer or DPTR is a 16-bit register. It is made
up of two 8-bit registers called DPH and DPL. Separate
addresses are assigned to each of DPH and DPL.These 8-
bit registers are used for the storing the memory
addresses that can be used to access internal and
external data/code.
22 Embedded Systems Prof.Anish Goel
Stack Pointer (SP)
 The stack pointer (SP) in 8051 is an 8-bit register.The
main purpose of SP is to access the stack.As it has 8-bits
it can take values in the range 00 H to FF H. Stack is a
special area of data in memory.The SP acts as a pointer
for an address that points to the top of the stack.
23 Embedded Systems Prof.Anish Goel
Data and Address Bus
 A bus is group of wires using which data transfer takes place from
one location to another within a system. Buses reduce the number
of paths or cables needed to set up connection between
components.
 There are mainly two kinds of buses - Data Bus and Address Bus.
 Data Bus:The purpose of data bus is to transfer data. It acts as an
electronic channel using which data travels.Wider the width of the bus,
greater will be the transmission of data.
 Address Bus:The purpose of address bus is to transfer information but
not data.The information tells from
where within the components, the data
should be sent to or received from.
The capacity or memory of the address
bus depends on the number of wires that
transmit a single address bit.
24 Embedded Systems Prof.Anish Goel

Weitere ähnliche Inhalte

Was ist angesagt?

8251 communication interface
8251 communication interface8251 communication interface
8251 communication interfaceLingalaSowjanya
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controllerabhikalmegh
 
Embedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerEmbedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerGaurav Verma
 
Password based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportPassword based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportChinaraja Baratam
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor DebrajJana4
 
8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijayVijay Kumar
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorRavi Anand
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontrollerthokalpv
 
Programmableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptProgrammableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptsharan Kumar
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerbhadresh savani
 
8086 pin details
8086 pin details8086 pin details
8086 pin detailsAJAL A J
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Daman Singh
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller NotesDr.YNM
 
Byte and string manipulation 8086
Byte and string manipulation 8086Byte and string manipulation 8086
Byte and string manipulation 8086mpsrekha83
 

Was ist angesagt? (20)

8255 PPI
8255 PPI8255 PPI
8255 PPI
 
8251 communication interface
8251 communication interface8251 communication interface
8251 communication interface
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
branch ins 8051
branch ins 8051branch ins 8051
branch ins 8051
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
Embedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerEmbedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontroller
 
Password based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportPassword based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final report
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
 
8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Programmableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptProgrammableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 ppt
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontroller
 
Microcontroller 8096
Microcontroller 8096Microcontroller 8096
Microcontroller 8096
 
8086 pin details
8086 pin details8086 pin details
8086 pin details
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 
Byte and string manipulation 8086
Byte and string manipulation 8086Byte and string manipulation 8086
Byte and string manipulation 8086
 

Andere mochten auch

Embedded systems ppt
Embedded systems pptEmbedded systems ppt
Embedded systems pptAshok Mutyala
 
Pc architecture michael karbo
Pc architecture   michael karboPc architecture   michael karbo
Pc architecture michael karboSecretTed
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of ComputersTallat Satti
 
Block diagram-of-8085
Block diagram-of-8085Block diagram-of-8085
Block diagram-of-8085Dhara Joshi
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolAditya Porwal
 
itft-8085 microprocessor
itft-8085 microprocessoritft-8085 microprocessor
itft-8085 microprocessorShifali Sharma
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller Gaurav Verma
 
Serial Communication
Serial CommunicationSerial Communication
Serial CommunicationRashmi
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfacesanishgoel
 
History of Computers (ENIAC and EDVAC)
History of Computers (ENIAC and EDVAC)History of Computers (ENIAC and EDVAC)
History of Computers (ENIAC and EDVAC)johnzter
 

Andere mochten auch (12)

Embedded systems ppt
Embedded systems pptEmbedded systems ppt
Embedded systems ppt
 
8086 new
8086 new8086 new
8086 new
 
Pc architecture michael karbo
Pc architecture   michael karboPc architecture   michael karbo
Pc architecture michael karbo
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of Computers
 
Block diagram-of-8085
Block diagram-of-8085Block diagram-of-8085
Block diagram-of-8085
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
itft-8085 microprocessor
itft-8085 microprocessoritft-8085 microprocessor
itft-8085 microprocessor
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
PCI & ISA bus
PCI & ISA busPCI & ISA bus
PCI & ISA bus
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfaces
 
History of Computers (ENIAC and EDVAC)
History of Computers (ENIAC and EDVAC)History of Computers (ENIAC and EDVAC)
History of Computers (ENIAC and EDVAC)
 

Ähnlich wie Embedded systems ppt i

Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051OGAGA OTOBOR
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller918007165995
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentseceprinter6
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller nitugatkal
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1haymanotyehuala
 
Microcontroller (1).pptx
Microcontroller (1).pptxMicrocontroller (1).pptx
Microcontroller (1).pptxITPradiptaRoy
 
Architecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 MicrocontrollerArchitecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 MicrocontrollerSudhanshu Janwadkar
 
Unit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesUnit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesPrabhu Mali
 
8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptxARYAKUMARNIRAV
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiramang6
 
Mmai ppt
Mmai pptMmai ppt
Mmai pptGIT
 
The hardware of the Mcs 51 microcontroller
 The hardware of the Mcs 51 microcontroller The hardware of the Mcs 51 microcontroller
The hardware of the Mcs 51 microcontrollerGarba Geidam
 

Ähnlich wie Embedded systems ppt i (20)

Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller
 
Micro controller
Micro controllerMicro controller
Micro controller
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Embeded system
Embeded systemEmbeded system
Embeded system
 
89s52 2
89s52 289s52 2
89s52 2
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1
 
POA_Unit 5.pptx
POA_Unit 5.pptxPOA_Unit 5.pptx
POA_Unit 5.pptx
 
Microcontroller (1).pptx
Microcontroller (1).pptxMicrocontroller (1).pptx
Microcontroller (1).pptx
 
c++
c++ c++
c++
 
Architecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 MicrocontrollerArchitecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 Microcontroller
 
Unit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesUnit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notes
 
8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unit
 
Mmai ppt
Mmai pptMmai ppt
Mmai ppt
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
Embedded System
Embedded SystemEmbedded System
Embedded System
 
The hardware of the Mcs 51 microcontroller
 The hardware of the Mcs 51 microcontroller The hardware of the Mcs 51 microcontroller
The hardware of the Mcs 51 microcontroller
 

Mehr von anishgoel

Computer Organization
Computer OrganizationComputer Organization
Computer Organizationanishgoel
 
Learning vhdl by examples
Learning vhdl by examplesLearning vhdl by examples
Learning vhdl by examplesanishgoel
 
Dot matrix module interface wit Raspberry Pi
Dot matrix module interface wit Raspberry PiDot matrix module interface wit Raspberry Pi
Dot matrix module interface wit Raspberry Pianishgoel
 
Input interface with Raspberry pi
Input interface with Raspberry piInput interface with Raspberry pi
Input interface with Raspberry pianishgoel
 
Learning Python for Raspberry Pi
Learning Python for Raspberry PiLearning Python for Raspberry Pi
Learning Python for Raspberry Pianishgoel
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pianishgoel
 
learning vhdl by examples
learning vhdl by exampleslearning vhdl by examples
learning vhdl by examplesanishgoel
 
Digital System Design Basics
Digital System Design BasicsDigital System Design Basics
Digital System Design Basicsanishgoel
 
digital design of communication systems
digital design of communication systemsdigital design of communication systems
digital design of communication systemsanishgoel
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos conceptsanishgoel
 
8051 Microcontroller Timer
8051 Microcontroller Timer8051 Microcontroller Timer
8051 Microcontroller Timeranishgoel
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O portsanishgoel
 
Embedded systems ppt iv part d
Embedded systems ppt iv   part dEmbedded systems ppt iv   part d
Embedded systems ppt iv part danishgoel
 
Embedded systems ppt iv part c
Embedded systems ppt iv   part cEmbedded systems ppt iv   part c
Embedded systems ppt iv part canishgoel
 
Embedded systems ppt iv part b
Embedded systems ppt iv   part bEmbedded systems ppt iv   part b
Embedded systems ppt iv part banishgoel
 
Embedded systems ppt ii
Embedded systems ppt iiEmbedded systems ppt ii
Embedded systems ppt iianishgoel
 
Embedded systems ppt iii
Embedded systems ppt iiiEmbedded systems ppt iii
Embedded systems ppt iiianishgoel
 
Embedded systems ppt iv part a
Embedded systems ppt iv   part aEmbedded systems ppt iv   part a
Embedded systems ppt iv part aanishgoel
 
Nios2 and ip core
Nios2 and ip coreNios2 and ip core
Nios2 and ip coreanishgoel
 

Mehr von anishgoel (20)

Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
Learning vhdl by examples
Learning vhdl by examplesLearning vhdl by examples
Learning vhdl by examples
 
Dot matrix module interface wit Raspberry Pi
Dot matrix module interface wit Raspberry PiDot matrix module interface wit Raspberry Pi
Dot matrix module interface wit Raspberry Pi
 
Input interface with Raspberry pi
Input interface with Raspberry piInput interface with Raspberry pi
Input interface with Raspberry pi
 
Learning Python for Raspberry Pi
Learning Python for Raspberry PiLearning Python for Raspberry Pi
Learning Python for Raspberry Pi
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
learning vhdl by examples
learning vhdl by exampleslearning vhdl by examples
learning vhdl by examples
 
Digital System Design Basics
Digital System Design BasicsDigital System Design Basics
Digital System Design Basics
 
digital design of communication systems
digital design of communication systemsdigital design of communication systems
digital design of communication systems
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
 
8051 Microcontroller Timer
8051 Microcontroller Timer8051 Microcontroller Timer
8051 Microcontroller Timer
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
Embedded systems ppt iv part d
Embedded systems ppt iv   part dEmbedded systems ppt iv   part d
Embedded systems ppt iv part d
 
Embedded systems ppt iv part c
Embedded systems ppt iv   part cEmbedded systems ppt iv   part c
Embedded systems ppt iv part c
 
Embedded systems ppt iv part b
Embedded systems ppt iv   part bEmbedded systems ppt iv   part b
Embedded systems ppt iv part b
 
Embedded systems ppt ii
Embedded systems ppt iiEmbedded systems ppt ii
Embedded systems ppt ii
 
Embedded systems ppt iii
Embedded systems ppt iiiEmbedded systems ppt iii
Embedded systems ppt iii
 
Embedded systems ppt iv part a
Embedded systems ppt iv   part aEmbedded systems ppt iv   part a
Embedded systems ppt iv part a
 
Cpld fpga
Cpld fpgaCpld fpga
Cpld fpga
 
Nios2 and ip core
Nios2 and ip coreNios2 and ip core
Nios2 and ip core
 

Kürzlich hochgeladen

Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEselvakumar948
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 

Kürzlich hochgeladen (20)

Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 

Embedded systems ppt i

  • 1. Introduction to Microcontroller and 8051 Architecture Prof. Anish Goel Embedded Systems
  • 2. Micro Controller  A micro controller is an integrated circuit or a chip with a processor and other support devices like program memory, data memory, I/O ports, serial communication interface etc integrated together.  Unlike a microprocessor (ex: Intel 8085), a microcontroller does not require any external interfacing of support devices.  Intel 8051 is the most popular microcontroller ever produced in the world market. 2 Embedded Systems Prof.Anish Goel
  • 3. Microprocessor vs Microcontroller 3 Embedded Systems Prof.Anish Goel
  • 4. 8051 Pin Diagram & Description 4 Embedded Systems Prof.Anish Goel
  • 5. Description  Pin-40 : Named asVcc is the main power source. Usually its +5V DC.  Pins 32-39: Known as Port 0 (P0.0 to P0.7) – In addition to serving as I/O port,lower order address and data bus signals are multiplexed with this port (to serve the purpose of external memory interfacing).This is a bi directional I/O port (the only one in 8051) and external pull up resistors are required to function this port as I/O.  Pin-31:-ALE aka Address Latch Enable is used to demultiplex the address- data signal of port 0 (for external memory interfacing.) 2 ALE pulses are available for each machine cycle.  Pin-30:- EA/ External Access input is used to enable or disallow external memory interfacing. If there is no external memory requirement, this pin is pulled high by connecting it toVcc.  Pin- 29:- PSEN or Program Store Enable is used to read signal from external program memory.  Pins- 21-28:- Known as Port 2 (P 2.0 to P 2.7) – in addition to serving as I/O port, higher order address bus signals are multiplexed with this quasi bi directional port.  Pin 20:- Named asVss – it represents ground (0V) connection. 5 Embedded Systems Prof.Anish Goel
  • 6. Description  Pins 18 and 19:- Used for interfacing an external crystal to provide system clock.  Pins 10 – 17:- Known as Port 3.This port also serves some other functions like interrupts, timer input, control signals for external memory interfacing RD andWR , serial communication signals RxD and TxD etc.This is a quasi bi directional port with internal pull up.  Pin 9:- As explained before RESET pin is used to set the 8051 microcontroller to its initial values, while the microcontroller is working or at the initial start of application.The RESET pin must be set high for 2 machine cycles.  Pins 1 – 8:- Known as Port 1. Unlike other ports, this port does not serve any other functions. Port 1 is an internally pulled up, quasi bi directional I/O port. 6 Embedded Systems Prof.Anish Goel
  • 7. 8051 Internal Architecture 7 Embedded Systems Prof.Anish Goel
  • 8. 8051 Microcontroller Block Diagram 8 Embedded Systems Prof.Anish Goel
  • 9. ALU  All arithmetic and logical functions are carried out by the ALU. Addition, subtraction with carry, and multiplication come under arithmetic operations. Logical AND, OR and exclusive OR (XOR) come under logical operations. 9 Embedded Systems Prof.Anish Goel
  • 10. Program Counter (PC)  A program counter is a 16-bit register and it has no internal address.The basic function of program counter is to fetch from memory the address of the next instruction to be executed.The PC holds the address of the next instruction residing in memory and when a command is encountered, it produces that instruction.This way the PC increments automatically, holding the address of the next instruction. 10 Embedded Systems Prof.Anish Goel
  • 11. Registers  Registers are usually known as data storage devices. 8051 microcontroller has 2 registers, namely Register A and Register B. Register A serves as an accumulator while Register B functions as a general purpose register.These registers are used to store the output of mathematical and logical instructions. The operations of addition, subtraction, multiplication and division are carried out by Register A. Register B is usually unused and comes into picture only when multiplication and division functions are carried out by Register A.  Register A also involved in data transfers between the microcontroller and external memory. 11 Embedded Systems Prof.Anish Goel
  • 12. Special Function Registers  8051 microcontroller also has 7 Special Function Registers (SFRs).They are:  1. Serial Port Data Buffer (SBUF) 2.Timer/Counter Control (TCON) 3.Timer/Counter Mode Control (TMOD) 4. Serial Port Control (SCON) 5. Power Control (PCON) 6. Interrupt Priority (IP) 7. Interrupt Enable Control (IE) 12 Embedded Systems Prof.Anish Goel
  • 13. Timers and Counters  Synchronization among internal operations can be achieved with the help of clock circuits which are responsible for generating clock pulses. During each clock pulse a particular operation will be carried out, thereby, assuring synchronization among operations. For the formation of an oscillator, we are provided with two pins XTAL1 and XTAL2 which are used for connecting a resonant network in 8051 microcontroller device. In addition to this, circuit also consists of four more pins.They are, Internal operations can be synchronized using clock circuits which produce clock pulses.With each clock pulse, a particular function will be accomplished and hence synchronization is achieved.There are two pins XTAL1 and XTAL2 which form an oscillator circuit which connect to a resonant network in the microcontroller.The circuit also has 4 additional pins - 1. EA: External enable 2.ALE:Address latch enable 3. PSEN: Program store enable and 4. RST: Reset. 13 Embedded Systems Prof.Anish Goel
  • 14. Internal RAM and ROM  ROM  A code of 4K memory is incorporated as on-chip ROM in 8051.The 8051 ROM is a non-volatile memory meaning that its contents cannot be altered and hence has a similar range of data and program memory, i.e, they can address program memory as well as a 64K separate block of data memory. RAM  The 8051 microcontroller is composed of 128 bytes of internal RAM.This is a volatile memory since its contents will be lost if power is switched off.These 128 bytes of internal RAM are divided into 32 working registers which in turn constitute 4 register banks (Bank 0-Bank 3) with each bank consisting of 8 registers (R0 - R7).There are 128 addressable bits in the internal RAM. 14 Embedded Systems Prof.Anish Goel
  • 15. Memory Mapping of 8051 15 Embedded Systems Prof.Anish Goel
  • 16. Four General Purpose Parallel Input/Output Ports  The 8051 microcontroller has four 8-bit input/output ports.These are: PORT P0:When there is no external memory present, this port acts as a general purpose input/output port. In the presence of external memory, it functions as a multiplexed address and data bus. It performs a dual role. PORT P1:This port is used for various interfacing activities.This 8-bit port is a normal I/O port i.e. it does not perform dual functions. PORT P2: Similar to PORT P0, this port can be used as a general purpose port when there is no external memory but when external memory is present it works in conjunction with PORT PO as an address bus.This is an 8-bit port and performs dual functions. PORT P3: PORT P3 behaves as a dedicated I/O port 16 Embedded Systems Prof.Anish Goel
  • 17. Interrupt Control  An event which is used to suspend or halt the normal program execution for a temporary period of time in order to serve the request of another program or hardware device is called an interrupt.An interrupt can either be an internal or external event which suspends the microcontroller for a while and thereby obstructs the sequential flow of a program. There are two ways of giving interrupts to a microcontroller – one is by sending software instructions and the other is by sending hardware signals.The interrupt mechanism keeps the normal program execution in a "put on hold" mode and executes a subroutine program and after the subroutine is executed, it gets back to its normal program execution.This subroutine program is also called an interrupt handler.A subroutine is executed when a certain event occurs. 17 Embedded Systems Prof.Anish Goel
  • 18. Interrupt  In 8051, 5 sources of interrupts are provided.They are: a) 2 external interrupt sources connected through INT0 and INT1 b) 3 external interrupt sources- serial port interrupt, Timer Flag 0 and Timer Flag 1. 18 Embedded Systems Prof.Anish Goel
  • 19. Serial Data Communication  A method of establishing communication among computers is by transmitting and receiving data bits is a serial connection network. In 8051, the SBUF (Serial Port Data Buffer) register holds the data; the SCON (Serial Control) register manages the data communication and the PCON (Power Control) register manages the data transfer rates. Further, two pins - RXD andTXD, establish the serial network.  The SBUF register has 2 parts – one for storing the data to be transmitted and another for receiving data from outer sources. The first function is done using TXD pin and the second function is done using RXD pin. 19 Embedded Systems Prof.Anish Goel
  • 20. PSW  Program StatusWord or PSW is a hardware register which is a memory location which holds a program's information and also monitors the status of the program this is currently being executed. PSW also has a pointer which points towards the address of the next instruction to be executed. PSW register has 3 fields namely are instruction address field, condition code field and error status field.We can say that PSW is an internal register that keeps track of the computer at every instant.  Generally, the instruction of the result of a program is stored in a single bit register called a 'flag'. The are7 flags in the PSW of 8051. Among these 7 flags, 4 are math flags and 3 are general purpose or user flags. 20 Embedded Systems Prof.Anish Goel
  • 21. Flags  The 4 Math flags are: • Carry (c) • Auxiliary carry (AC) • Overflow (OV) • Parity (P) The 3 General purpose flags or User flags are: • FO • GFO • GF 1 21 Embedded Systems Prof.Anish Goel
  • 22. Data Pointer (DPTR)  The data pointer or DPTR is a 16-bit register. It is made up of two 8-bit registers called DPH and DPL. Separate addresses are assigned to each of DPH and DPL.These 8- bit registers are used for the storing the memory addresses that can be used to access internal and external data/code. 22 Embedded Systems Prof.Anish Goel
  • 23. Stack Pointer (SP)  The stack pointer (SP) in 8051 is an 8-bit register.The main purpose of SP is to access the stack.As it has 8-bits it can take values in the range 00 H to FF H. Stack is a special area of data in memory.The SP acts as a pointer for an address that points to the top of the stack. 23 Embedded Systems Prof.Anish Goel
  • 24. Data and Address Bus  A bus is group of wires using which data transfer takes place from one location to another within a system. Buses reduce the number of paths or cables needed to set up connection between components.  There are mainly two kinds of buses - Data Bus and Address Bus.  Data Bus:The purpose of data bus is to transfer data. It acts as an electronic channel using which data travels.Wider the width of the bus, greater will be the transmission of data.  Address Bus:The purpose of address bus is to transfer information but not data.The information tells from where within the components, the data should be sent to or received from. The capacity or memory of the address bus depends on the number of wires that transmit a single address bit. 24 Embedded Systems Prof.Anish Goel