SlideShare a Scribd company logo
MICROCONTROLLER LAB- 8051
Balaji Ramakrishna
MICROCONTROLLERS
Prof.
Cherrice
Traver
ECE/CS-352:
Embedded
Microcontroller
Systems
CPU ROM
RAM
I/O
A single chip
Subsystems:
Timers, Counters, Analog
Interfaces, I/O interfaces
Memory
PIN DIAGRAM
COMMON MICROCONTROLLERS
•Atmel
•ARM
•Intel
•8-bit
•8XC42
•MCS48
•MCS51
•8xC251
•16-bit
•MCS96
•MXS296
•National Semiconductor
•COP8
•Microchip
•12-bit instruction PIC
•14-bit instruction PIC
•PIC16F84
•16-bit instruction PIC
•NEC
•Motorola
•8-bit
•68HC05
•68HC08
•68HC11
•16-bit
•68HC12
•68HC16
•32-bit
•683xx
•Texas Instruments
•TMS370
•MSP430
•Zilog
•Z8
•Z86E02
THE NECESSARY TOOLS FOR A
MICROPROCESSOR/CONTROLLER
 CPU: Central Processing Unit
 I/O: Input /Output
 Bus: Address bus & Data bus
 Memory: RAM & ROM
 Timer
 Interrupt
 Serial Port
 Parallel Port
MICROCONTROLLER ARCHITECTURES
CPU
Program
+ Data
Address Bus
Data Bus
Memory
Von Neumann
Architecture
CPU
Program
Address Bus
Data Bus
Harvard
Architecture
Memory
Data
Address Bus
Fetch Bus
0
0
0
2n
“ORIGINAL” 8051 MICROCONTROLLER
Oscillator
and timing
4096 Bytes
Program
Memory
128 Bytes
Data
Memory
Two 16 Bit
Timer/Event
Counters
8051
CPU
64 K Byte
Bus
Expansion
Control
Programmable
I/O
Programmable
Serial Port Full
Duplex UART
Synchronous
Shifter
Internal data bus
External interrupts
subsystem interrupts
Control Parallel ports
Address Data Bus
I/O pins
Serial Input
Serial Output
8051 ARCHITECTURE
 RAM memory space allocation in the 8051
7FH
30H
2FH
20H
1FH
17H
10H
0FH
07H
08H
18H
00H
Register Bank 0
(Stack) Register Bank 1
Register Bank 2
Register Bank 3
Bit-Addressable RAM
Scratch pad RAM
 Memory space
BIT ADDRESSABLE RAM
Figure 2-6
Summary
of the 8051
on-chip
data
memory
(RAM)
BIT ADDRESSABLE RAM
PROGRAM STATUS WORD (PSW)
ACCESSING EXTERNAL
DATA MEMORY
ACCESSING EXTERNAL
CODE MEMORY
INTERFACING WITH EXTERNAL ROM
EXTERNAL MEMORY
EXTERNAL MEMORY TIMING DIAGRAM
THE EA' (EXTERNAL ACCESS) PIN IS USED TO CONTROL THE INTERNAL
OR EXTERNAL MEMORY ACCESS.
THE SIGNAL 0 IS FOR EXTERNAL MEMORY ACCESS AND SIGNAL 1 FOR
INTERNAL MEMORY ACCESS.
THE PSEN' (PROGRAM STORE ENABLE) IS FOR READING EXTERNAL
CODE MEMORY WHEN IT IS LOW (0) AND EA IS ALSO 0.
THE ALE (ADDRESS LATCH ENABLE) ACTIVATES THE PORT 0 JOINED
WITH PORT 2 TO PROVIDE 16 BIT EXTERNAL ADDRESS BUS TO ACCESS
THE EXTERNAL MEMORY. THE ALE MULTIPLEXES THE P0:
ALE=1 FOR LATCHING ADDRESS ON P0 AS A0-A7 IN THE 16 BIT
ADDRESS BUSS, ALE=0 FOR LATCHING P0 AS DATA I/O.
P0.X IS NAMED ADX BECAUSE P0 IS MULTIPLEXED FOR ADDRESS BUS
AND DATA BUS AT DIFFERENT CLOCK TIME.
WR' PROVIDES THE SIGNAL TO WRITE EXTERNAL DATA MEMORY
RD' PROVIDES THE SIGNAL TO READ EXTERNAL DATA AND CODE
MEMORY.
ACCESSING ROM USING INDEXED
ADDRESSING
INDEXED ADDRESSING
PORT 0
PORT1
PORT 2
PORT3
There are 4 8-bit ports: P0, P1, P2 and P3. All of them are dual
purpose ports except P1 which is only used for I/O. The following
diagram shows a single bit in an 8051 I/O port.
When a program writes a one byte value to a port or a single bit value
to a bit of a port, assigning the value to the port as follows:
P1 = 0x12; or P1^2=1;
P1 represents the 8 bits of port 1 and P1^2 is the pin #2 of the port 1
of 8051 defined in the reg51.h of C51, a C dedicated for 8051
family.
When data is written to the port pin, it first appears on the latch input
(D) and is then passed through to the output (Q) and through an
inverter to the Field Effect Transistor (FET).
If you write a logic 0 to the port pin(DFF Q=0), it is inverted to logic 1
and turns on the FET gate. It makes the port pin connected to
ground (logic 0).
If logic 1 is written to the port pin(DFF Q=1), , then it is inverted to a
logic 0 and turns off the FET gate. Therefore the pin is at logic 1
because it is connected to high.
 PORT P1 (Pins 1 to 8): The port P1 is a port dedicated for general
I/O purpose. The other ports P0, P2 and P3 have dual roles in
addition to their basic I/O function.
 PORT P0 (pins 32 to 39): When the external memory access is
required then Port P0 is multiplexed for address bus and data bus
that can be used to access external memory in conjunction with
port P2. P0 acts as A0-A7 in address bus and D0-D7 for port data.
It can be used for general purpose I/O if no external memory
presents.
 PORT P2 (pins 21 to 28): Similar to P0, the port P2 can also play a
role (A8-A15) in the address bus in conjunction with PORT P0 to
access external memory.
 PORT P3 (Pins 10 to 17):
In addition to acting as a normal I/O port,
 P3.0 can be used for serial receive input pin(RXD)
 P3.1 can be used for serial transmit output pin(TXD)
in a serial port,
 P3.2 and P3.3 can be used as external interrupt
pins(INT0’ and INT1’),
 P3.4 and P3.5 are used for external counter input
pins(T0 and T1),
 P3.6 and P3.7 can be used as external data memory
write and read control signal pins(WR’ and RD’)read
and write pins for memory access.

More Related Content

PPT
Power Point Presentation on Microcontrollers
PPT
The Intel MCS-51 is a single-chip microcontroller series developed by Intel
PPTX
8051-Special Purpose Registers and Memory Interface.pptx
PPT
Ch3 ppt
DOC
4th yr dmumicrocontroller1
PPTX
microcontroller 8051 hfdsdsyghydfhdsgukhdfsdgjkghu
PPTX
MICROCONTROLLER 8051- Architecture and registers
PPT
Microcontroller 8051
Power Point Presentation on Microcontrollers
The Intel MCS-51 is a single-chip microcontroller series developed by Intel
8051-Special Purpose Registers and Memory Interface.pptx
Ch3 ppt
4th yr dmumicrocontroller1
microcontroller 8051 hfdsdsyghydfhdsgukhdfsdgjkghu
MICROCONTROLLER 8051- Architecture and registers
Microcontroller 8051

Similar to MICROCONTROLLER 8051 ARCHITECTURE BASIC.ppt (20)

PPTX
PPTX
Microcontroller (8051) by K. Vijay Kumar
PPTX
8051 microcontroller by K. Vijay Kumar
PDF
assignment 1-MC.pdf
PPTX
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
PPT
Microcontroller 8051 By Mitesh kumar
PPT
Microcontroller 8051
PPTX
3-8051 Microcontroller-28-01-2024 (1).pptx
PDF
Embedded systems io programming
PPT
Microcontroller 8051
PPT
PPT
Microcontroller 8051
PPT
8051microcontrollerbyvijay-140520010732-phpapp01.ppt
PPTX
Unit two and unit three pptx for btech ece
PDF
8051 Hardware Architecture, Addressing Modes, Interfacing
PDF
Pin Description of the 8051 along with I/O Interfacing
PDF
Introduction Architecture Addressing Modes
PDF
microcontroller intel 8051 pin description
PDF
Instruction Set Architecture and Design of Hardware
PDF
21ECU502_UNIT1.pdf
Microcontroller (8051) by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar
assignment 1-MC.pdf
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
Microcontroller 8051 By Mitesh kumar
Microcontroller 8051
3-8051 Microcontroller-28-01-2024 (1).pptx
Embedded systems io programming
Microcontroller 8051
Microcontroller 8051
8051microcontrollerbyvijay-140520010732-phpapp01.ppt
Unit two and unit three pptx for btech ece
8051 Hardware Architecture, Addressing Modes, Interfacing
Pin Description of the 8051 along with I/O Interfacing
Introduction Architecture Addressing Modes
microcontroller intel 8051 pin description
Instruction Set Architecture and Design of Hardware
21ECU502_UNIT1.pdf
Ad

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
IGGE1 Understanding the Self1234567891011
PDF
Classroom Observation Tools for Teachers
Cell Types and Its function , kingdom of life
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
Chinmaya Tiranga quiz Grand Finale.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
A systematic review of self-coping strategies used by university students to ...
History, Philosophy and sociology of education (1).pptx
Computing-Curriculum for Schools in Ghana
Final Presentation General Medicine 03-08-2024.pptx
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Complications of Minimal Access Surgery at WLH
Orientation - ARALprogram of Deped to the Parents.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Paper A Mock Exam 9_ Attempt review.pdf.
Final Presentation General Medicine 03-08-2024.pptx
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
IGGE1 Understanding the Self1234567891011
Classroom Observation Tools for Teachers
Ad

MICROCONTROLLER 8051 ARCHITECTURE BASIC.ppt

  • 2. MICROCONTROLLERS Prof. Cherrice Traver ECE/CS-352: Embedded Microcontroller Systems CPU ROM RAM I/O A single chip Subsystems: Timers, Counters, Analog Interfaces, I/O interfaces Memory
  • 4. COMMON MICROCONTROLLERS •Atmel •ARM •Intel •8-bit •8XC42 •MCS48 •MCS51 •8xC251 •16-bit •MCS96 •MXS296 •National Semiconductor •COP8 •Microchip •12-bit instruction PIC •14-bit instruction PIC •PIC16F84 •16-bit instruction PIC •NEC •Motorola •8-bit •68HC05 •68HC08 •68HC11 •16-bit •68HC12 •68HC16 •32-bit •683xx •Texas Instruments •TMS370 •MSP430 •Zilog •Z8 •Z86E02
  • 5. THE NECESSARY TOOLS FOR A MICROPROCESSOR/CONTROLLER  CPU: Central Processing Unit  I/O: Input /Output  Bus: Address bus & Data bus  Memory: RAM & ROM  Timer  Interrupt  Serial Port  Parallel Port
  • 6. MICROCONTROLLER ARCHITECTURES CPU Program + Data Address Bus Data Bus Memory Von Neumann Architecture CPU Program Address Bus Data Bus Harvard Architecture Memory Data Address Bus Fetch Bus 0 0 0 2n
  • 7. “ORIGINAL” 8051 MICROCONTROLLER Oscillator and timing 4096 Bytes Program Memory 128 Bytes Data Memory Two 16 Bit Timer/Event Counters 8051 CPU 64 K Byte Bus Expansion Control Programmable I/O Programmable Serial Port Full Duplex UART Synchronous Shifter Internal data bus External interrupts subsystem interrupts Control Parallel ports Address Data Bus I/O pins Serial Input Serial Output
  • 9.  RAM memory space allocation in the 8051 7FH 30H 2FH 20H 1FH 17H 10H 0FH 07H 08H 18H 00H Register Bank 0 (Stack) Register Bank 1 Register Bank 2 Register Bank 3 Bit-Addressable RAM Scratch pad RAM
  • 11. BIT ADDRESSABLE RAM Figure 2-6 Summary of the 8051 on-chip data memory (RAM)
  • 19. THE EA' (EXTERNAL ACCESS) PIN IS USED TO CONTROL THE INTERNAL OR EXTERNAL MEMORY ACCESS. THE SIGNAL 0 IS FOR EXTERNAL MEMORY ACCESS AND SIGNAL 1 FOR INTERNAL MEMORY ACCESS. THE PSEN' (PROGRAM STORE ENABLE) IS FOR READING EXTERNAL CODE MEMORY WHEN IT IS LOW (0) AND EA IS ALSO 0. THE ALE (ADDRESS LATCH ENABLE) ACTIVATES THE PORT 0 JOINED WITH PORT 2 TO PROVIDE 16 BIT EXTERNAL ADDRESS BUS TO ACCESS THE EXTERNAL MEMORY. THE ALE MULTIPLEXES THE P0: ALE=1 FOR LATCHING ADDRESS ON P0 AS A0-A7 IN THE 16 BIT ADDRESS BUSS, ALE=0 FOR LATCHING P0 AS DATA I/O. P0.X IS NAMED ADX BECAUSE P0 IS MULTIPLEXED FOR ADDRESS BUS AND DATA BUS AT DIFFERENT CLOCK TIME. WR' PROVIDES THE SIGNAL TO WRITE EXTERNAL DATA MEMORY RD' PROVIDES THE SIGNAL TO READ EXTERNAL DATA AND CODE MEMORY.
  • 20. ACCESSING ROM USING INDEXED ADDRESSING
  • 23. PORT1
  • 25. PORT3
  • 26. There are 4 8-bit ports: P0, P1, P2 and P3. All of them are dual purpose ports except P1 which is only used for I/O. The following diagram shows a single bit in an 8051 I/O port. When a program writes a one byte value to a port or a single bit value to a bit of a port, assigning the value to the port as follows: P1 = 0x12; or P1^2=1; P1 represents the 8 bits of port 1 and P1^2 is the pin #2 of the port 1 of 8051 defined in the reg51.h of C51, a C dedicated for 8051 family. When data is written to the port pin, it first appears on the latch input (D) and is then passed through to the output (Q) and through an inverter to the Field Effect Transistor (FET). If you write a logic 0 to the port pin(DFF Q=0), it is inverted to logic 1 and turns on the FET gate. It makes the port pin connected to ground (logic 0). If logic 1 is written to the port pin(DFF Q=1), , then it is inverted to a logic 0 and turns off the FET gate. Therefore the pin is at logic 1 because it is connected to high.
  • 27.  PORT P1 (Pins 1 to 8): The port P1 is a port dedicated for general I/O purpose. The other ports P0, P2 and P3 have dual roles in addition to their basic I/O function.  PORT P0 (pins 32 to 39): When the external memory access is required then Port P0 is multiplexed for address bus and data bus that can be used to access external memory in conjunction with port P2. P0 acts as A0-A7 in address bus and D0-D7 for port data. It can be used for general purpose I/O if no external memory presents.  PORT P2 (pins 21 to 28): Similar to P0, the port P2 can also play a role (A8-A15) in the address bus in conjunction with PORT P0 to access external memory.
  • 28.  PORT P3 (Pins 10 to 17): In addition to acting as a normal I/O port,  P3.0 can be used for serial receive input pin(RXD)  P3.1 can be used for serial transmit output pin(TXD) in a serial port,  P3.2 and P3.3 can be used as external interrupt pins(INT0’ and INT1’),  P3.4 and P3.5 are used for external counter input pins(T0 and T1),  P3.6 and P3.7 can be used as external data memory write and read control signal pins(WR’ and RD’)read and write pins for memory access.