SlideShare a Scribd company logo
1 of 43
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.
• 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.
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.
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?
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
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

Similar to micro controllers 1.ppt

8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollersnehapvs
 
Module -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxModule -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxDrVaibhavMeshram
 
I. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.pptI. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.pptHAriesOa1
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessorssudheerkethamreddy
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentationxavierpaulino
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERAnkita Jaiswal
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf818Farida
 
Microcontroller overview 1
Microcontroller overview 1Microcontroller overview 1
Microcontroller overview 1Sally Salem
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentalsJLoknathDora
 
POA_Unit 5.pptx
POA_Unit 5.pptxPOA_Unit 5.pptx
POA_Unit 5.pptxGAURAVWANI11
 
8051 microcontroller and embedded training (sahil gupta 9068557926)
8051 microcontroller and embedded training  (sahil gupta   9068557926)8051 microcontroller and embedded training  (sahil gupta   9068557926)
8051 microcontroller and embedded training (sahil gupta 9068557926)Sahil Gupta
 
Micro controller
Micro controllerMicro controller
Micro controllerShrikunj Patel
 
Introduction to microcontrollers
Introduction to microcontrollersIntroduction to microcontrollers
Introduction to microcontrollersEdwardOmondi4
 
Module 5 embedded systems,8051
Module 5 embedded systems,8051Module 5 embedded systems,8051
Module 5 embedded systems,8051Deepak John
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Mrunal Deshkar
 

Similar to micro controllers 1.ppt (20)

8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Module -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxModule -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptx
 
I. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.pptI. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.ppt
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessors
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
 
PILOT Session for Embedded Systems
PILOT Session for Embedded Systems PILOT Session for Embedded Systems
PILOT Session for Embedded Systems
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
Uc1(vii sem)
Uc1(vii sem)Uc1(vii sem)
Uc1(vii sem)
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf
 
Microcontroller overview 1
Microcontroller overview 1Microcontroller overview 1
Microcontroller overview 1
 
AT89 S52
AT89 S52AT89 S52
AT89 S52
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentals
 
8051 slide
8051 slide8051 slide
8051 slide
 
POA_Unit 5.pptx
POA_Unit 5.pptxPOA_Unit 5.pptx
POA_Unit 5.pptx
 
8051 microcontroller and embedded training (sahil gupta 9068557926)
8051 microcontroller and embedded training  (sahil gupta   9068557926)8051 microcontroller and embedded training  (sahil gupta   9068557926)
8051 microcontroller and embedded training (sahil gupta 9068557926)
 
Micro controller
Micro controllerMicro controller
Micro controller
 
Introduction to microcontrollers
Introduction to microcontrollersIntroduction to microcontrollers
Introduction to microcontrollers
 
Module 5 embedded systems,8051
Module 5 embedded systems,8051Module 5 embedded systems,8051
Module 5 embedded systems,8051
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor
 
Ee6008 mcbsd notes
Ee6008 mcbsd notesEe6008 mcbsd notes
Ee6008 mcbsd notes
 

Recently uploaded

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 

Recently uploaded (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 

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.
  • 6.
  • 7.
  • 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.
  • 9.
  • 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.
  • 16.
  • 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?
  • 19.
  • 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
  • 27.
  • 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)