Documente Academic
Documente Profesional
Documente Cultură
ERS
8051
WHAT IS A
MICROCONTROLLER?
• All of the components needed for a
controller were built right onto one
chip.
• A one chip computer, or
microcontroller was born.
• A microcontroller is a highly
integrated chip which includes, on
one chip, all or most of the parts
needed for a controller.
• The microcontroller could be called a
MICROPROCESSOR vs MICRO
CONTROLLER
MICROPROCESSOR Vs MICRO
CONTROLLER
General-purpose
Microcontroller
microprocessors
v The fixed amount of
q Must add RAM, ROM, on-chip ROM, RAM,
I/O ports, and timers and number of I/O
externally to make ports makes them
them functional ideal for
q Make the system applications in
bulkier and much which cost and
more expensive space are critical.
q Have the advantage of v In many applications,
versatility on the the space it takes,
amount of RAM, the power it
ROM, and I/O ports consumes, and the
Features :
• The Intel 8051 is used in
embedded systems
– 8-bit CPU
– 4k bytes ROM for the
program
– 128 BYTES of RAM for
variables
– 32 I/O lines ( 4 PORTS WITH
8 EACH )
– 2 timers
– 1 Serial port
– 6 interrupt sources
– Low cost (10-15 cents per
Block Diagram
External Interrupts
CPU
OSC Bus
4 I/O Ports Serial
Control
P0 P2 P1 P3 TXD RXD
Addr/Data
8051 – PIN
DIAGRAM
8051 – 40 PIN IC
•
C1
XTAL1
30pF
GND
XTAL Connection to an External Clock Source
EXTERNAL
OSCILLATOR
SIGNAL XTAL1
GND
RST - RESET
• RST ( pin 9 ): reset
– input pin and active high
• The high pulse must be high at
least 2 machine cycles.
– power-on reset.
• Upon applying a high pulse to
RST, the microcontroller will
reset and all values in registers
will be lost.
• Reset values of some 8051
registers
RESET Value of Some 8051 Registers:
PC 0000
ACC 0000
B 0000
PSW 0000
SP 0007
DPTR 0000
31
EA/VPP
X1
10 uF 30 pF
X2
RST
9
8.2 K
EA’ & PSEN’
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.
–active low.
PSEN’ ( pin 29 ): program store enable
–This is an output pin and is connected to the
OE pin of the ROM.
ALE
ALE ( pin 30 ): address
latch enable
vIt is an output pin
and is active high.
v8051 port 0
provides both
address and data.
vThe ALE pin is used
for de-multiplexing
the address and data
by connecting to the G
pin of the 74LS373
latch.
External code memory
WR
RD
PSEN OE
ALE 74LS373 CS
G
P0.0 A0
D
P0.7 A7
D0
D7
EA
P2.0 A8
P2.7 A15
8051 ROM
External data memory
WR WR
RD RD
PSEN
ALE 74LS373 CS
G
P0.0 A0
D
P0.7 A7
D0
D7
EA
P2.0 A8
P2.7 A15
8051 RAM