lect5
lect5
8-bit MCU
• Low cost
• Inexpensive development software
• Low Power Design
1
lect 5 4/19/2025
8051
Schematic Pin out
P1.0 1 40 Vcc
P1.1 2 39 P0.0(AD0)
P1.2 3 38 P0.1(AD1)
-The 8051 is a 40 pin P1.3 4 37 P0.2(AD2)
device, but out of these P1.4 5 36 P0.3(AD3)
P1.5 6 35 P0.4(AD4)
40 pins, 32 are used for P1.6 7 34 P0.5(AD5)
I/O. P1.7
RST
8
9
8051 33
32
P0.6(AD6)
P0.7(AD7)
(RXD)P3.0 10 (8031) 31 EA/VPP
-24 of these are dual (TXD)P3.1 11 30 ALE/PROG
purpose, i.e. they can (INT0)P3.2 12
(8751) 29 PSEN
operate as I/O (INT1)P3.3 13 (8951) 28 P2.7(A15)
or a control line (T0)P3.4 14 27 P2.6(A14)
or as part of address (T1)P3.5 15 26 P2.5(A13)
or date bus. (WR)P3.6 16 25 P2.4(A12)
(RD)P3.7 17 24 P2.3(A11)
XTAL2 18 23 P2.2(A10)
XTAL1 19 22 P2.1(A9)
GND 20 21 P2.0(A8)
2
lect 5 4/19/2025
One of the most useful features of the 8051 is that it contains four I/O ports (P0 - P3)
Each port can be used as input or output (bi-direction)
Port 0
pins 32-39 (P0.0-P0.7)
• 8-bit R/W - General Purpose
I/O
• Or acts as a multiplexed low
byte address and data bus for
external memory design
Port 1
pins 1-8 (P1.0-P1.7)
• Only 8-bit R/W - General
Purpose I/O
3
lect 5 4/19/2025
Port 2
• pins 21-28 (P2.0-P2.7)
• 8-bit R/W - General
Purpose I/O
• Or high byte of the
address bus for external
memory design
Port 3
pins 10-17 (P3.0-P3.7)
• General Purpose I/O
• if not using any of the internal
peripherals (timers) or external
interrupts.
4
lect 5 4/19/2025
IMPORTANT PINS
• PSEN (out): Program Store Enable, the read signal for external program memory (active
low).
• This is an output pin and is connected to the OE pin of the ROM.
• EA (in): External Access Enable, active low to access external program memory locations
0 to 4K
• 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.
• ALE (out): Address Latch Enable, to latch address outputs at Port0 and Port2
• 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 by connecting to the G
pin of the 74LS373 latch.
5
lect 5 4/19/2025
IMPORTANT PINS
C1
XTAL1
30pF
GND
6
lect 5 4/19/2025
NC XTAL2
EXTERNAL
OSCILLATOR XTAL1
SIGNAL
GND
IMPORTANT PINS
7
lect 5 4/19/2025