EE222 Lecture 13-24 8051 Microcontroller
EE222 Lecture 13-24 8051 Microcontroller
EE222 Lecture 13-24 8051 Microcontroller
Memory
Processor I/O Devices
RAM,ROM
Data Bus
COMPUTING DEVICES
• Desktop computers
• Embedded systems
– An embedded system is an application that
contains at least one programmable computer and
which is used by individuals who are, in the main,
unaware that the system is computer-based.
INSIDE A PROCESSOR
• Registers to store information temporarily
• ALU to perform arithmetic and logic functions
• Program Counter
• Instruction Decoder
INSIDE A PROCESSOR
Address Bus
Program Counter
Flags ALU
Instruction Register
Control Bus
Instruction
decoder, timing,
And control
Data Bus
Registers
A MICROPROCESSOR BASED SYSTEM
Memory
Memory ROM RAM
CPU
Processor I/O
I/O Subsystems:
Timers, Counters, Analog
On a Board Interfaces, I/O interfaces
A single chip
PIC MICROCONTROLLERS
ARM MICROCONTROLLERS
• ARM7 processor family
• ARM9 processor family
• ARM11 processor family
• Cortex
ATMEL MICROCNTROLLERS
• AVR 8 bit, 32 bit
• 8051 Architecture
• ARM Based
8051 MICROCONTROLLER
OVERVIEW OF 8051 FAMILY
• 8051 was introduced by
Intel in 1981
• 8 bit microcontroller
• Popular versions of 8051
are;
– AT89C51
– DS5000
– P89C51
XTAL2
30pF
XTAL1
30pF
GND
+
10 uF
31
EA/VPP
30 pF X1
19
11.0592 MHz
8.2
K X2
30 pF 18
9 RST
Pin Description
• EA ( pin 31 )
– external access
– There is no on-chip ROM in 8031 and 8032 .
– The /EA pin is connected to GND to indicate the code is stored
externally.
– PSEN & ALE are used for external ROM.
– For 8051, EA pin is connected to Vcc.
• PSEN ( pin 29 )
– Program store enable
– This is an output pin and is connected to the OE pin of the ROM.
Pin Description
• ALE ( pin 30 )
– address latch enable.
– It is an output pin and is active high.
– 8051 port 0 provides both address and data.
– The ALE pin is used for de-multiplexing the address and data.
• I/O port pins
– The four ports P0, P1, P2, and P3.
– Each port uses 8 pins.
– All I/O pins are bi-directional.
Pin Description
• P1, P2, and P3 have internal pull-up resisters.
– P1, P2, and P3 are not open drain.
• P0 has no internal pull-up resistors and does not connects to Vcc inside
the 8051.
– P0 is open drain.
• However, for a programmer, it is the same to program P0, P1, P2 and
P3.
Port 3 Alternate Functions
P3 Bit Function Pin
P3.0 RxD 10
P3.1 TxD 11
P3.2 INT0 12
P3.3 INT1 13
P3.4 T0 14
P3.5 T1 15
P3.6 WR 16
P3.7 RD 17
Memory Structure &
Addressing Modes
Chapter 5
Internal Code Memory
Reset 000H
EX0 003H
Timer 0 00BH
EX1 013H
Timer 1 01BH
Reset 000H
EX0 003H
Timer 0 00BH
EX1 013H
Timer 1 01BH