2a Prof. Shabiul Lecture Ch-2 1 Octo 2023
2a Prof. Shabiul Lecture Ch-2 1 Octo 2023
1
ECE2216 Microcontroller and Microprocessor Systems
Chapter 2:
The MCS-51 Microcontroller
3
Power Connection Pins
C1, C2 = 30 pF 10 pF
C2
XTAL1 [Pin 19]
7
Port 0
o A dual-purpose port on pins 32 – 39.
o For small design, it is used as general purpose I/O port.
o For larger designs with external memory, this port becomes a
multiplexed low-byte address and data bus to access the
external program and data memory.
Port 1
o A dedicated I/O port on pins 1 – 8.
o No alternate function are assigned to
this port, thus they are solely for
interfacing with external devices.
8
Port 2
o A dual-purpose I/O port on pins
21 – 28.
o For designs with external
memory, this port serves as the
high-byte address bus.
Port 3
o A dual-purpose I/O port on pins
10 – 17.
o This pins are multifunctional,
with each having an alternate
purpose related to special
features of the 8051.
9
Alternate pin functions for Port 3
Bit Name Bit Address Alternate Function
10
P1 – P3 Port Structure Write a ‘1’ of make
pin an input pin
TB2
P1.X
P1.X ‘1’
latch
‘0’
TB1
P2 and P3 port structures are basically the same as P1, except with
extra circuitry to allow dual functions. 11
Vcc
Warning:
This connection would
damage the transistor.
12
P0 Port Structure Warning:
An external pull-up
resistor is needed to
drive an input.
TB2
P0.X
P0.X
TB1
13