Microprocessor & Microcontroller
Microprocessor & Microcontroller
() SER
( ) o Pims fovts amà ckJ
() lns true son et
(Micro brocef
ro 3
DPTE
.FFFF,
S
KAM Externa L
Memry
2
|
Lnternal Psw
PnteStete
rmMeaemmry
ria/Gmtyster
7.15 8051/8031 cycles. theand 7.17. 805A used
PSW to
When Fig.iscapacitance
7.18 whenA is
machine bus 0 the
B, in
reset.ACC,shown Figure busaddress
FF F7 EF E7 DF D7 CF C7 BE B7 AF A7 9F 97 for port
supply data of
PCON pin. moremanual 0, one-Sixth
PC, is uF
cycles. =
from this or of diagram A10 andof ALE
twoandvalues terminals. clock low-byte
address
drawn to respect
capacito. It
for reset circuit Ap- ofrate
reset 24 to
is
1W. with
current
high
power-on aboutuF thethe A, constant
TH1. the resetground10 demultiplexing
provides
bus
80S1
Microcontroller
Architecture map is
aboutspecified So delay
125-mA pin lost.power-on and
the address
a
memory is RST across
THÌ as provide 0
Port with
ratingare such be RST as
when
SFR A dissipation will The between addedformemory. usedperiodically
voltage. voltagesmicrocontroller components
TL1 DPH
7.14 only to 0007H.
register is
used is
the connected switch O
Fig, supply 8051, is external
port
powerAll is ALE activated
TLO DPL the SP These push-button 1,
supply.
the in of =
V 8051 withALE
Enable)
+5 maximumresets values content
is pin.
is
TMOD to 8.2K interfacing
SP connected for reset RST WhenALE
pin pin all theof A Latch
the ground to reset, resistance
input to circuit. D. Usually,
ACC PSW P2/ SCON P1 TCON PO and ways and Vcc
IE 0000H to
fromreset(Address
P3
RST isMicrocontroller is
is microcontroller
pin a two
microcontroller
D,
is pull-down busbus.
F8 FO E8 EO D8 DO C8 CO B8 B0 A8 A0 98 90 88 80 This This The are are manual
Connected datadata
frequency.
DPTR ALE
Vss RSTThere
Vcc and ne
A the
Fig.7.13 Bit addressabl
Each of the
to as bits
can also be20.0-20.7 and bits 8-FH are the same as 21.0-21.7, and so on. 16-bytes im his
addressed as a byte. RAM. On the.
Scratch Pad
stack pointer hasArea
general purpose
The memory locations 30H-7FH areshould be left aside to prevent Sp
been initializedon-chip
to this area,
RAM
enough
are
bytes
used for special function registers as
dataindestFig,
shown
The upper 128 bytes of
Actually, only 25 of these the
bytes are used. The other bytes are reserved for advanced versione of
the
controller. These bytes are associated
with registers whích are used for different functions
and opera
microcontroller. ne bit ad£dressable and some of these bytes
COntroller. Some of these rerista are addressable.
PSW 7 PSW 0
PSW 6 PSW 1
PSW 5 PSW 2User-definable flag
PSW 4 PSW 3
Sack Pointer (SP) This is an 8-bit register. SP is incremented before the data is stored onto the stack
Using PUSH/CALL instructions execution. During PUSH operation, first increment SP and then copy the
va ln the POP operation, initiallycopy the data and then decrement SP. The 8-bit address of the stack top
Ored in this register. The stack can be located anywhere in the on-chip 128-byte RAM. Initially, the stack
POmier is initialised to 07H after reset operation. Hence the stack begins at locations 08H. The stack can be
relocated by setting SP tothe upper memory area in 30Hto 7FH.
Uata Pointer (DTPR)(DTPR is 16-bitregister. It consists of a higher byte (DPH) and a lowerbyt (DPL,)
T-DteXemal ata ESAV address. Ican be accessed as two 8-bit registers ora l6-bit regi_ter. DTPR has
been given two addresses in the special-function register bank. DPTR is very useful for string operations and
look-up 7.8
asSuppose input memoryoutput can can byte input beThe is Port therememory as in 64
r.he Serial a DPTR Kof
nsmit The alsocommunicated allotted
be ofaddresses
buffers general-purpose 0, is
port. port line used th e Port location,no off-chiptable
Port the write be
Ports used external to such through
buffer registers (P3.1 as of the
al Data port of 1, operations.
strobeinputtoutput Port instruction
latches Port MOVX program
and
ta Buffer
address are external ), as corresponding with MØV
specify
also (P3.6)
I/O memory 0 register.
and 2,
eceive port. With
e ofused Port
other are Port
DPTR,#XXXX
port in R), memory
The Pl the Interrupt and The address stored
2, ICs 38051 @DPTR To 16-bit
buffer is as
value and on-chip
er serial 90H external pins are and Latches increment
bit in to can
addressable. lines of acts
itand used the decrement DPTR.
the DPTR,
Mlicrocontrollers
Microprocessorsand
is atport in to all and be
athe SFR, bedata Port input/output I/O instrucion.
output (P3.2, an
Port inspecial and
port. MOVX
the addressed.
in data
same important accesses a
The memory have
3rolein 2 maximum
outputs functionDrivers Al l contents
buffer "The on P3.3),
@DPTR,#XX
utation. address to ports ToFor
internally first
the readalternate
external externalsignals.
specific the register
ár e of read this, of
of bit strobe higher latch
Ech
and DPTR, 54
nsmitThe functions bidirectional data16-bit Kof
PI.0 of programming timer
The
r.consists output
port (P3.7).
memory. bank. are
is byte output INC memory from off-chip
9OH has input such used
The port of Using
In
DPTR memory
buffer of and the the corresponding
drivers respectively.
or lines as of thisinputoutput data
ial two Port same read serial external these location
internal instruction
ependent is (P3.4, case, location memory
address addresses, of
ata a addressvalue input
llel-in PortPorts
P3.5), memory memory This address
fer from
portsdriver and
of line 0 is and
outputs Oand executed. can
registers P1.7 asthe external ports of a
is the (P3.0), of
address. of also write maximum
wi l
ser 8
specified
is
register. 8051.
2, bitsports
97H. the and 0-3 bedata be
sucht data serial each. 03 But, used stored
P3 PIlow the can in of
up
ory Ory
up upoy
stem ncies
e of
blean Setssible KB data
-chipf
of tesofelpof VO,
are
B data be
Ter.AcCumul SExternal explained ROM,
referredator Interrupts
transfer e
interrupt
Four 6
After
miregicrocsAsynchronous
in
otenrs,trol eProgrammable
rFigur7.e.2 resetport clockout sourcesFrequency
this level
and as shows 8-bit
any implicit(ACC) priorities
rithmetic Control
section,latches beenhas the VO range
Oscillator interrupt
Betic CPU
H simplified ports
and
depicted interrupt
orThe Fig. to0
specified drivers 33MHZ
tructions. 7.2
is Accumulator
ations, in
block
Schematic ALERST
ed ROM byte4k for Fig.
in PSENEA, Control Bus
g the the 7.3
Ports diagram
ccumulator block which
P0
B instruction
result register of
ply consists
P, 8051
is Address/bata
(ACC) diagram P,
stored is by Ports
Four/O RAM byte microcontroller.
and 128 and of
B also its acts of P, ALU,
P.
.ivide ACC. inbit SFR as 8051 P, The
control
an
Pa
addressable.addressmicrocontroller
ations operand operation
and The
ter detailed
timing
OEOH. TxD TimerTimer0 1
to ACC.2 register. PortSerial
A of
each unit,
architecture
n store ACCusedfor R*D
f The
operands
secondthe states block
RAM/EPROM/
commonly Counter
Inputs
the
accumulato; has of
and bit been 8051
2
sion, of
ACC may
in
vel
controller trollers.
trollers
tionscontr such classified 4-bit procesSors
applications.
high-speed different
Microprocessors AICROPROCESSOR 7.2
microprocessors
8-bit Microprocessor
microcomputer
systems.
on ) It of
MiCroprOceSsor lable
Microprocessors RAMmanipuBations,
with consists It
nibbles has microprocessor
ng as to
microprocessors the
are
speedFour-bit 32-bit applications. and address 7.1
into oktside
are and ROM of Comparison
such illustrated used an
control, 4-bit bytes. bus,
registers
ICs microcontrollers are areinstructions are are world. ALU is
as
microcontrollers for data RAM is a
used
available used not Microprocessor
single-chip
given
are
esservo
microcontrollers,
with 16-bit,
position in personal incorporated bus and to between
Table most for as perform
controltheir the and below.
32-bit simple from perform a CONTROLBUS
commonly control ROM
as computers control DATABUS CPU.
features.
control, 7.2. are CPU arithmetic microprocessor
ystem,
well and
applications. 4-bit
are operations in within unit.
Generally, available 64-bit the bus The
as extensively8-bit to PORTS TIMERS MierocontroerM
Microprocessorsnd
used
and 64-bit4-bit for block
ly and chip, and
botics, The interfacing
microcontrollers,
any in micro in ba_ed logic
16-bit 8-bit diagran
the and
ge etc. process
microcontrollers used market. mieroeontroMler
ontrollers
These in applicaions. cations.
Microcontrollers
microcontrollers (Microcontrollers
bytes,
microcontroller-based thYoughPi
itaddress parallel It
control different in and Microcontroller operations productssystem. the Microcontroller
RAM
is
tem The
consists
g. electronics Based 32-bit not MEMORY as
words, ROM FRAM microcontroller
ollers 16-b1t is given
8-bit sufficient,
smaller, and
system. microcontrollers to L/O,
on and perform of
microcontrollers the
are toys microcontrollers or data Ptimers, CPU, beloW.
are are instructions
are evenother but
used number are thencommunícates P:
developed Table bus Microcontroller
bit
ome and available
used operations
double
control-oriented it and external data
rIMERSICOUNTERSKTEPMEMT is
in
used external
depending is FRECNSTEAS
a
can example for enough Pa and single-chíp
7.3
various ex of are
shows are in ports. program and
be bits, simple fromwords.
areused
ed
hig in for such abl small
and most memory. for internal
control
highmicrocontrollers for 4-bit small uponPorts with
the of
32-hit applications. functions)
as to
commonly high embedded memory,
4-bit perform
based outside
speed
different to may
applications. control can
interrupts.
applicatio- mieroco speed 32-bit.
microco on be be
bit-lev
nibbl added serial
16-b syse signa used
use app 4-b wr