0% found this document useful (0 votes)
12 views13 pages

2a Prof. Shabiul Lecture Ch-2 1 Octo 2023

Uploaded by

j2yshjzzsx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

2a Prof. Shabiul Lecture Ch-2 1 Octo 2023

Uploaded by

j2yshjzzsx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Lecture No: 2A

Prof. Dr. Md. Shabiul Islam


Faculty of Engineering,
Multimedia University, Cyberjaya
Email: [email protected]

1
ECE2216 Microcontroller and Microprocessor Systems

Chapter 2:
The MCS-51 Microcontroller

Part 1: Introduction to the 8051


microcontroller
8051 (standard) Microcontroller
Pin Configuration

3
Power Connection Pins

• The 8051 operates from a single +5V supply (V cc).

• Vcc connection is on pin 40, and the

• Vss (GND) connection is on pin 20.


4
On-chip Oscillator Input
C1
XTAL2 [Pin 18]

C1, C2 = 30 pF  10 pF
C2
XTAL1 [Pin 19]

 Typically driven by a crystal connected to pins 18


(XTAL2) and 19 (XTAL1).
 The nominal crystal frequency is 12MHz for most ICs
in MCS-51TM family.
 TTL clock source may also be connected to XTAL1
and XTAL2.
5
Control Pins

• Program Store Enable (PSEN): Read strobe to external program


memory.
• Activated (held low) when executing code from the external
program memory.
• Not activated during internal program memory fetching.
• Address Latch Enable (ALE): An output pulse for latching the low
byte of the address during accesses to external memory.
• External Access (EA): Must be externally held low (ground) to
enable the device to fetch code from external program memory. If
EA is held high (+5V), the device executes program from internal
program memory.
• Reset (RST): Whenever this pin output is high for two machine
cycles while the oscillator is running, it will reset the device.
6
I/O Pins
• The 8051 has 32 pins of I/O port lines. However, 24 of
these lines are dual-purpose.
• Each of the lines may operate as I/O, or as a control line, or
part of the address or data bus.
• The 8 lines in each port can be treated as a unit in
interfacing with parallel devices such as printers, digital-to-
analog converters and etc.
• The lines can be also treated independently in interfacing to
a single-bit device such as switches, LEDs, transistors,
motors and loudspeakers.
• There are four I/O ports in 8051 microcontroller, they are:
Port 0, Port 1, Port 2, Port 3

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

P3.0 RXD B0H Receive data for serial port


P3.1 TXD B1H Transmit data for serial port
P3.2 INT0 B2H External interrupt 0
P3.3 INT1 B3H External interrupt 1
P3.4 T0 B4H Timer/counter 0 external input
P3.5 T1 B5H Timer/counter 1 external input
P3.6 WR B6H External data memory write strobe
P3.7 RD B7H External data memory read strobe

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.

Ways to protect the pin: Exercise:


Draw the circuits
 Input switch with pull-up resistor.
 Input switch with ground only, and no Vcc.
 Connect input switch to a 74LS244 tri-state buffer before
it is fed to the 8051 pin.

12
P0 Port Structure Warning:
An external pull-up
resistor is needed to
drive an input.
TB2

P0.X

P0.X

TB1

13

You might also like