SlideShare a Scribd company logo
4.1 MICRO CONTROLLERS
4.2 8051
MICROCONTROLLERS
UNIT 4
4.1 Micro Controllers
OUTLINE
1) Embedded system and general purpose systems
2) What is microcontroller?
3) What are different types of microcontroller?
4) How to select controller for a given application?
5) Applications..
EMBEDDED SYSTEM AND
GENERAL PURPOSE COMPUTERS
System:-
A system is an arrangement in which all its unit assemble
work together according to a set of rules. It can also be
defined as a way of working, organizing or doing one or
many tasks according to a fixed plan.
For example, a watch is a time displaying system.
If one of its parts fails, the watch will stop working. So we can say, in
a system, all its subcomponents depend on each other.
EMBEDDED SYSTEM
• Embedded means something that is attached to another thing.
• An embedded system can be thought of as a computer hardware
system having software embedded in it.
• An embedded system can be an independent system or it can be
a part of a large system.
• An embedded system is a microcontroller or microprocessor
based system which is designed to perform a specific task.
• For example, a fire alarm is an embedded system; it will sense
only smoke.
micro controllers 1.ppt
micro controllers 1.ppt
• An embedded system has three components −
• It has hardware.
• It has application software.
• It has Real Time Operating system (RTOS)
• RTOS defines the way the system works. It sets the rules
during the execution of application program.
• A small scale embedded system may not have RTOS.
micro controllers 1.ppt
INTRODUCTION TO
MICROCONTROLLERS
•Microprocessor = CPU on a single
chip.
•> ALU + registers + control +…
•Micro-computer = small computer
•uP + I/O + memory + peripheral +
…
• Microcontroller (uC)
A Microprocessor System
Contains the same 6 basic components:
–Arithmetic logic unit (ALU)
–Register array
–Control unit
–Memory
–Input unit
–Output unit
Basic Microprocessor Systems
MICROPROCESSOR
• Microprocessor: a CPU on a single
integrated chip (IC)
• a special type of CPU
• The brain of a computer
• E.g.:
• – 8086, 80286, 80386, 80486,
Pentium, Core 2 Duo, Core 2
Quad, K5, K6, Atholon, Atholon
64, Opteron, Phenon, PowerPC
G4, PowerPC G5, Xenon,
Broadway, Cell, …
• Contains no RAM, no ROM, no I/O
ports on chip.
MICROCONTROLLERS
CPU
ROM RAM
I/O
A single chip
Subsystems:
Timers, Counters, Analog
Interfaces, I/O interfaces
Memory
MICROCONTROLLER :
• A microprocessor, and RAM, ROM, I/O ports, and
timer on a single chip. Also called MCU
(MicroController Unit)
• , uC
• “Computer on a chip”
• Usually not as powerful as general purpose
microprocessor
• Low power consumption, small in size, low cost.
• A lot of MCUs are application specific (as against
the general purpose microprocessor).μC
DIFFERENCE BETWEEN ΜP AND ΜC
Sr. No
µP µC
1 Several Instructions for moving Data from
external memory to CPU.
One or two instructions for
moving the data from
external memory to CPU.
2 In µP few pins are multi functioned. In µC large number of
pins are multi
functioned.
3 Designer can decide on the amount of
ROM, RAM and I/O ports.
Fixed program and data
memory.
4 Uses different ICs for memory and I/O Inbuilt Memory and I/O.
5 No Inbuilt timer. Inbuilt timer is there.
micro controllers 1.ppt
1. 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
2. Availability of software development tools
• assemblers, debuggers, C compilers, emulator,
simulator, technical support
3. Wide availability and reliable sources of the
microcontrollers.
Three criteria in Choosing a Microcontroller
– Speed
– Power consumption
– Amount of RAM and ROM on chip
– Number of I/O pins
– Cost per unit
– Packaging
HOW DO WE DECIDE WHICH MCU TO
USE?
micro controllers 1.ppt
KAGES
PLCC
Plastic
Leaded
Chip
Carrier
Cygnal 8051 MCU in
TQFP64.(Thin Quad Flat Pack)
PDIP: Plastic Dual In Line Package
BASIC MICROPROCESSOR
SYSTEMS
Architecture uses physically separate memories for
their instructions and data, requiring dedicated buses
for each of them. Instructions and operands can
therefore be fetched simultaneously.
Different program and data bus widths are possible,
allowing program and data memory to be better
optimized to the architectural requirements.
E.g.: If the instruction format requires 14 bits then program bus
and memory can be made 14-bit wide, while the data bus and
data memory remain 8-bit wide.
IF A DEVICE OR AN APPLICATION INVOLVES
MEASURING, STORING, CALCULATING,
CONTROLLING OR DISPLAYING INFORMATION,
THEN DEVICE CONTAINS A MICROCONTROLLER IN
IT.
4.2 8051 MICROCONTROLLERS
Brief History of 8051
• The first microprocessor 4004 was invented by Intel
Corporation.
• 8085 and 8086 microprocessors were also invented
by Intel.
• In 1981, Intel introduced an 8-bit microcontroller
called the 8051.
• It was referred as system on a chip because it had
128 bytes of RAM, 4K byte of on-chip ROM, two
timers, one serial port, and 4 ports (8-bit wide), all on
a single chip.
8051 BASIC COMPONENT
• Central Processing Unit (CPU)
• Program Memory (ROM – Read Only Memory)
• Data Memory (RAM – Random Access Memory)
• Timers and Counters
• I/O Ports (I/O – Input/Output)
• Serial Communication Interface
• Clock Circuit (Oscillator Circuit)
• Interrupt Mechanism
RAM
I/O
Port
counter
Timer
Serial
COM
Port
Microcontroller
CPU
A single chip
ROM
BLOCK DIAGRAM
CPU
Interrupt
Control
OSC Bus
Control
4k
ROM
Timer 1
Timer 2
Serial
128 bytes
RAM
4 I/O Ports
TXD RXD
External Interrupts
P0 P2 P1 P3
Addr/Data
micro controllers 1.ppt
BASIC COMPONENTS PRESENT INSIDE
8051 MICROCONTROLLER
ARCHITECTURE ARE:
1. 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.
• 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.
2. 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 then 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.
Types of interrupt in 8051 Microcontroller:
The five sources of interrupts in 8051 Microcontroller:
1) Timer 0 overflow interrupt - TF0
2) Timer 1 overflow interrupt - TF1
3) External hardware interrupt - INT0
4) External hardware interrupt - INT1
5) Serial communication interrupt - RI/TI
MEMORY:
1. For operation Micro-controller required a program.
2. This program guides the microcontroller to perform the specific
tasks.
3. This program installed in microcontroller required some on chip
memory for the storage of the program.
4. Microcontroller also required memory for storage of data and
operands for the short duration.
5. 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 :
1. Bus is a group of wires which uses as a
communication canal or acts as means of
data transfer.
2. The different bus configuration includes 8,
16 or more cables. Therefore, a bus can
bear 8 bits, 16 bits all together.
• Timers/Counters
• Timers are used to create a time gap or delay between two events.
• The timer produces the delay according to the demand of the processor and sends the signal to the
processor once the respective delay gets produced.
• As the microcontroller is digital circuit therefore it needs timer for their operation.
• Oscillator:
• 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.
• Input/Output Port
• 8051 consists of 4 parallel ports of 8 bit each thereby providing
32 input-output pins.
• All the 4 ports function bidirectionally i.e., either input or
output according to the software control.
ACCUMULATOR
• ACC is the accumulator register. It holds most of the
results of mathematical and logical operations of the
8051.
• It is also used for all data transfer between the 8051 and
any external memory.
Register B
The register B is Used during multiply and divide
operations.
Serial Data Buffer
When transmitting data ,it holds the data to be
transmitted and while receiving ,it holds the receiving
data.
1. An 8-bit CPU with two registers A (ACC or accumulator) and B
2. Internal Flash ROM of 8KB – It is a flash memory that supports in – system
programming.
3. Internal RAM of 256 bytes – The first 128 Bytes of the RAM i.e. 00H to 7FH is again
divided in to 4 banks with 8 registers (R0 – R7) in each bank, 16 bit addressable
registers and 80 general purpose registers.
4. The higher 128 Bytes of the RAM i.e. 80H to FFH consists of Special Function
Registers (SFR) which are used to control different peripherals such as Timers, Serial
Port, all I/O Ports, etc.
5. 32 I/O Pins – Arranged as 4 Ports: P0, P1, P2 and P3
6. 8-bit Stack Pointer (SP) and Processor Status Word (PSW)
7. 16-bit Program Counter (PC) and Data Pointer (DPTR)
8. Two 16-bit timers – T0 and T1
9. Interrupts – Two external and three internal
10. Oscillator and clock circuit
11. Serial Data Transmitter and Receiver for Full-Duplex operation – SBUF
12. Control Registers – SCON, PCON, TCON, TMOD, IP and IE
8051
SCHEMATIC
PIN OUT
PORT
1. Term "port" refers to a group of pins on a microcontroller
which can be accessed simultaneously, or on which we can
set the desired combination of zeros and ones, or read from
them an existing status.
2. Physically, port is a register inside a microcontroller which is
connected by wires to the pins of a microcontroller. Ports
represent physical connection of Central Processing Unit with
an outside world.
3. Microcontroller uses them in order to monitor or control
other components or devices.
4. Due to functionality, some pins have twofold roles.
5. All port pins can be designated as input or output, according
to the needs of a device that's being developed.
IMPORTANT PINS (IO PORTS)
• One of the most useful features = 4 I/O ports (P0 - P3)
 Port 0 :-P0 = (P0.0 - P0.7)
8-bit R/W - General Purpose I/O
low byte address and data bus for external
memory
 Port 1 :- P1= (P1.0 - P1.7)
Only 8-bit R/W - General Purpose I/O
 Port 2 :- P2 = (P2.0 - P2.7)
8-bit R/W - General Purpose I/O
high byte address for external memory
 Port 3:- P3 = (P3.0 - P3.7)
General Purpose I/O
Timers(T0,T1) – ext. int (INT0, INT1) – Serial
(TXD, RXD)- RD,WR
Each port can be used as input or output (bi-direction)
PORT 3 ALTERNATE FUNCTIONS
IMPORTANT PINS
• 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.
OSCILLATOR CIRCUIT
• Oscillator circuit is used for providing a
microcontroller with a clock. Clock is needed
so that microcontroller could execute a
program or program instructions.
Machine cycle
• 8051 Clock and Instruction Cycle In 8051, one instruction
cycle consists of twelve (12) clock cycles. Instruction cycle
is sometimes called as Machine cycle by some authors.
•Instruction cycle of 8051
•In 8051, each instruction cycle has six states (S 1 - S 6 ).
•Each state has two pulses (P1 and P2)
micro controllers 1.ppt

More Related Content

PPTX
8051 microcontroller
PDF
microcontroller 8051 17.07.2023.pdf
PPT
8051 Microcontroller slides foe electronics
PPTX
Microcontrollers and its applications unit 1
PPT
Embedded systems, 8051 microcontroller
PDF
Architecture and Programmingpart1_Microcontroller
PPTX
microcontroller 8051 hfdsdsyghydfhdsgukhdfsdgjkghu
PDF
002079
8051 microcontroller
microcontroller 8051 17.07.2023.pdf
8051 Microcontroller slides foe electronics
Microcontrollers and its applications unit 1
Embedded systems, 8051 microcontroller
Architecture and Programmingpart1_Microcontroller
microcontroller 8051 hfdsdsyghydfhdsgukhdfsdgjkghu
002079

Similar to micro controllers 1.ppt (20)

PPTX
Microcontroller Electronics Engineering Sem 4MODULE 1.pptx
PPT
MICROCONTROLLER MODULE-1 PPT Includes basics of microcontroller , application...
PPTX
btech 8051 Microcontroller Programing.pptx
PPTX
Microcontroller (1).pptx
PPTX
LECT 2.pptx
PPT
Microcontroller-8051.ppt
PPT
8051 Presentation
PPTX
embedded system
PPTX
8051.pptx
PPTX
MPMC UNIT II edited . ppt X and communication
PDF
MICROCONTROLLER - INTEL 8051
PPTX
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
PPTX
8051 microcontroller Microcontroller _2024.pptx
PPT
8051 microcontroller and it’s interface
PDF
Embedded notes.iet.trichy
PDF
Embedded notes.iet.trichy
PPT
Microcontroller 8051
PPT
Architecture of 8051 microcontroller))
PPTX
8051 microcontroller features
Microcontroller Electronics Engineering Sem 4MODULE 1.pptx
MICROCONTROLLER MODULE-1 PPT Includes basics of microcontroller , application...
btech 8051 Microcontroller Programing.pptx
Microcontroller (1).pptx
LECT 2.pptx
Microcontroller-8051.ppt
8051 Presentation
embedded system
8051.pptx
MPMC UNIT II edited . ppt X and communication
MICROCONTROLLER - INTEL 8051
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
8051 microcontroller Microcontroller _2024.pptx
8051 microcontroller and it’s interface
Embedded notes.iet.trichy
Embedded notes.iet.trichy
Microcontroller 8051
Architecture of 8051 microcontroller))
8051 microcontroller features
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Cell Structure & Organelles in detailed.
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Computing-Curriculum for Schools in Ghana
master seminar digital applications in india
Sports Quiz easy sports quiz sports quiz
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O7-L3 Supply Chain Operations - ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
RMMM.pdf make it easy to upload and study
O5-L3 Freight Transport Ops (International) V1.pdf
Classroom Observation Tools for Teachers
Anesthesia in Laparoscopic Surgery in India
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Microbial diseases, their pathogenesis and prophylaxis
Cell Structure & Organelles in detailed.
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Complications of Minimal Access Surgery at WLH
PPH.pptx obstetrics and gynecology in nursing
human mycosis Human fungal infections are called human mycosis..pptx
Computing-Curriculum for Schools in Ghana
Ad

micro controllers 1.ppt

  • 1. 4.1 MICRO CONTROLLERS 4.2 8051 MICROCONTROLLERS UNIT 4
  • 3. OUTLINE 1) Embedded system and general purpose systems 2) What is microcontroller? 3) What are different types of microcontroller? 4) How to select controller for a given application? 5) Applications..
  • 4. EMBEDDED SYSTEM AND GENERAL PURPOSE COMPUTERS System:- A system is an arrangement in which all its unit assemble work together according to a set of rules. It can also be defined as a way of working, organizing or doing one or many tasks according to a fixed plan. For example, a watch is a time displaying system. If one of its parts fails, the watch will stop working. So we can say, in a system, all its subcomponents depend on each other.
  • 5. EMBEDDED SYSTEM • Embedded means something that is attached to another thing. • An embedded system can be thought of as a computer hardware system having software embedded in it. • An embedded system can be an independent system or it can be a part of a large system. • An embedded system is a microcontroller or microprocessor based system which is designed to perform a specific task. • For example, a fire alarm is an embedded system; it will sense only smoke.
  • 8. • An embedded system has three components − • It has hardware. • It has application software. • It has Real Time Operating system (RTOS) • RTOS defines the way the system works. It sets the rules during the execution of application program. • A small scale embedded system may not have RTOS.
  • 10. INTRODUCTION TO MICROCONTROLLERS •Microprocessor = CPU on a single chip. •> ALU + registers + control +… •Micro-computer = small computer •uP + I/O + memory + peripheral + … • Microcontroller (uC)
  • 11. A Microprocessor System Contains the same 6 basic components: –Arithmetic logic unit (ALU) –Register array –Control unit –Memory –Input unit –Output unit Basic Microprocessor Systems
  • 12. MICROPROCESSOR • Microprocessor: a CPU on a single integrated chip (IC) • a special type of CPU • The brain of a computer • E.g.: • – 8086, 80286, 80386, 80486, Pentium, Core 2 Duo, Core 2 Quad, K5, K6, Atholon, Atholon 64, Opteron, Phenon, PowerPC G4, PowerPC G5, Xenon, Broadway, Cell, … • Contains no RAM, no ROM, no I/O ports on chip.
  • 13. MICROCONTROLLERS CPU ROM RAM I/O A single chip Subsystems: Timers, Counters, Analog Interfaces, I/O interfaces Memory
  • 14. MICROCONTROLLER : • A microprocessor, and RAM, ROM, I/O ports, and timer on a single chip. Also called MCU (MicroController Unit) • , uC • “Computer on a chip” • Usually not as powerful as general purpose microprocessor • Low power consumption, small in size, low cost. • A lot of MCUs are application specific (as against the general purpose microprocessor).μC
  • 15. DIFFERENCE BETWEEN ΜP AND ΜC Sr. No µP µC 1 Several Instructions for moving Data from external memory to CPU. One or two instructions for moving the data from external memory to CPU. 2 In µP few pins are multi functioned. In µC large number of pins are multi functioned. 3 Designer can decide on the amount of ROM, RAM and I/O ports. Fixed program and data memory. 4 Uses different ICs for memory and I/O Inbuilt Memory and I/O. 5 No Inbuilt timer. Inbuilt timer is there.
  • 17. 1. 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 2. Availability of software development tools • assemblers, debuggers, C compilers, emulator, simulator, technical support 3. Wide availability and reliable sources of the microcontrollers. Three criteria in Choosing a Microcontroller
  • 18. – Speed – Power consumption – Amount of RAM and ROM on chip – Number of I/O pins – Cost per unit – Packaging HOW DO WE DECIDE WHICH MCU TO USE?
  • 20. KAGES PLCC Plastic Leaded Chip Carrier Cygnal 8051 MCU in TQFP64.(Thin Quad Flat Pack) PDIP: Plastic Dual In Line Package
  • 21. BASIC MICROPROCESSOR SYSTEMS Architecture uses physically separate memories for their instructions and data, requiring dedicated buses for each of them. Instructions and operands can therefore be fetched simultaneously. Different program and data bus widths are possible, allowing program and data memory to be better optimized to the architectural requirements. E.g.: If the instruction format requires 14 bits then program bus and memory can be made 14-bit wide, while the data bus and data memory remain 8-bit wide.
  • 22. IF A DEVICE OR AN APPLICATION INVOLVES MEASURING, STORING, CALCULATING, CONTROLLING OR DISPLAYING INFORMATION, THEN DEVICE CONTAINS A MICROCONTROLLER IN IT.
  • 24. Brief History of 8051 • The first microprocessor 4004 was invented by Intel Corporation. • 8085 and 8086 microprocessors were also invented by Intel. • In 1981, Intel introduced an 8-bit microcontroller called the 8051. • It was referred as system on a chip because it had 128 bytes of RAM, 4K byte of on-chip ROM, two timers, one serial port, and 4 ports (8-bit wide), all on a single chip.
  • 25. 8051 BASIC COMPONENT • Central Processing Unit (CPU) • Program Memory (ROM – Read Only Memory) • Data Memory (RAM – Random Access Memory) • Timers and Counters • I/O Ports (I/O – Input/Output) • Serial Communication Interface • Clock Circuit (Oscillator Circuit) • Interrupt Mechanism RAM I/O Port counter Timer Serial COM Port Microcontroller CPU A single chip ROM
  • 26. BLOCK DIAGRAM CPU Interrupt Control OSC Bus Control 4k ROM Timer 1 Timer 2 Serial 128 bytes RAM 4 I/O Ports TXD RXD External Interrupts P0 P2 P1 P3 Addr/Data
  • 28. BASIC COMPONENTS PRESENT INSIDE 8051 MICROCONTROLLER ARCHITECTURE ARE: 1. 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. • 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. 2. 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 then interrupts occur in current running program.
  • 29. • interrupts provide a method to postpone or delay the current process, performs a sub-routine task and then restart the standard program again. Types of interrupt in 8051 Microcontroller: The five sources of interrupts in 8051 Microcontroller: 1) Timer 0 overflow interrupt - TF0 2) Timer 1 overflow interrupt - TF1 3) External hardware interrupt - INT0 4) External hardware interrupt - INT1 5) Serial communication interrupt - RI/TI
  • 30. MEMORY: 1. For operation Micro-controller required a program. 2. This program guides the microcontroller to perform the specific tasks. 3. This program installed in microcontroller required some on chip memory for the storage of the program. 4. Microcontroller also required memory for storage of data and operands for the short duration. 5. 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.
  • 31. BUS : 1. Bus is a group of wires which uses as a communication canal or acts as means of data transfer. 2. The different bus configuration includes 8, 16 or more cables. Therefore, a bus can bear 8 bits, 16 bits all together.
  • 32. • Timers/Counters • Timers are used to create a time gap or delay between two events. • The timer produces the delay according to the demand of the processor and sends the signal to the processor once the respective delay gets produced. • As the microcontroller is digital circuit therefore it needs timer for their operation. • Oscillator: • 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.
  • 33. • Input/Output Port • 8051 consists of 4 parallel ports of 8 bit each thereby providing 32 input-output pins. • All the 4 ports function bidirectionally i.e., either input or output according to the software control.
  • 34. ACCUMULATOR • ACC is the accumulator register. It holds most of the results of mathematical and logical operations of the 8051. • It is also used for all data transfer between the 8051 and any external memory. Register B The register B is Used during multiply and divide operations. Serial Data Buffer When transmitting data ,it holds the data to be transmitted and while receiving ,it holds the receiving data.
  • 35. 1. An 8-bit CPU with two registers A (ACC or accumulator) and B 2. Internal Flash ROM of 8KB – It is a flash memory that supports in – system programming. 3. Internal RAM of 256 bytes – The first 128 Bytes of the RAM i.e. 00H to 7FH is again divided in to 4 banks with 8 registers (R0 – R7) in each bank, 16 bit addressable registers and 80 general purpose registers. 4. The higher 128 Bytes of the RAM i.e. 80H to FFH consists of Special Function Registers (SFR) which are used to control different peripherals such as Timers, Serial Port, all I/O Ports, etc. 5. 32 I/O Pins – Arranged as 4 Ports: P0, P1, P2 and P3 6. 8-bit Stack Pointer (SP) and Processor Status Word (PSW) 7. 16-bit Program Counter (PC) and Data Pointer (DPTR) 8. Two 16-bit timers – T0 and T1 9. Interrupts – Two external and three internal 10. Oscillator and clock circuit 11. Serial Data Transmitter and Receiver for Full-Duplex operation – SBUF 12. Control Registers – SCON, PCON, TCON, TMOD, IP and IE
  • 37. PORT 1. Term "port" refers to a group of pins on a microcontroller which can be accessed simultaneously, or on which we can set the desired combination of zeros and ones, or read from them an existing status. 2. Physically, port is a register inside a microcontroller which is connected by wires to the pins of a microcontroller. Ports represent physical connection of Central Processing Unit with an outside world. 3. Microcontroller uses them in order to monitor or control other components or devices. 4. Due to functionality, some pins have twofold roles. 5. All port pins can be designated as input or output, according to the needs of a device that's being developed.
  • 38. IMPORTANT PINS (IO PORTS) • One of the most useful features = 4 I/O ports (P0 - P3)  Port 0 :-P0 = (P0.0 - P0.7) 8-bit R/W - General Purpose I/O low byte address and data bus for external memory  Port 1 :- P1= (P1.0 - P1.7) Only 8-bit R/W - General Purpose I/O  Port 2 :- P2 = (P2.0 - P2.7) 8-bit R/W - General Purpose I/O high byte address for external memory  Port 3:- P3 = (P3.0 - P3.7) General Purpose I/O Timers(T0,T1) – ext. int (INT0, INT1) – Serial (TXD, RXD)- RD,WR Each port can be used as input or output (bi-direction)
  • 39. PORT 3 ALTERNATE FUNCTIONS
  • 40. IMPORTANT PINS • 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.
  • 41. OSCILLATOR CIRCUIT • Oscillator circuit is used for providing a microcontroller with a clock. Clock is needed so that microcontroller could execute a program or program instructions. Machine cycle • 8051 Clock and Instruction Cycle In 8051, one instruction cycle consists of twelve (12) clock cycles. Instruction cycle is sometimes called as Machine cycle by some authors.
  • 42. •Instruction cycle of 8051 •In 8051, each instruction cycle has six states (S 1 - S 6 ). •Each state has two pulses (P1 and P2)