i~.
83C152 HARDWARE DESCRIPTION
Externaldata memoryis accessed
like an 80C51BH,
with “MOVX”instructions.Addresaeaup to 64Kmay
be massed when using the Data Pointer (DPTR).
when
accesshg externaldata memorywiththe D-
the address appearson Port Oand 2. When usingthe
DPTR, if leas than 64K of external data memoryis
u- the address is emitted on all sixteenpim. This
means that whenusingthe DPTR, the pins of Port 2
not used for addressescarmotbe used for generalpur-
pose1/0. An alternativeto usingId-bit addresseswith
the DPTR is to use ROor R1 to address the external
data memory.Whenusingthe registers to addressex-
ternal data memory,the addressrange is limitedto 256
bytea.However,softwaremanipulationof I/O Port 2
pinsas normal 1/0, allowsthis 256bytesrestrictionto
be expandedviabankswitching.When usingROor RI
as data pointers, Port 2 pins that are not used for ad-
dressing,can beusedas generalpurpose 1/0.
2.1.2.1 Bit Addressable Memory
The C152has severrdmemoryspacesin whichthe bits
are directly addressedby their location. The directly
addressablebitsandtheir symbolicnamesare shownin
Figure 2.3A,2.3B,and 2.3C.
Bit addreaaesOto 7FH reaide in on-board user data
RAM in byteaddresses20Hto 2FH (seeFigure2.3A).
Bit addream 80Hto OFFHresidein the SFR memory
space,but not everySFR is bit addressable,see Figure
2.3B.The addressablebits are scattered throughoutthe
SFRS.The addressablebits occureveryeighthSFR ad-
dress starting at 80Hand occupythe entire byte. Most
of the bits that are addressablein the SFRShave been
givensymbolicnsrne3.These names will often be re-
ferred to in this or other documentationon the C152.
Most assemblersalso allow the use of the symbolic
names when writing in assembly language. These
namesare shownin ~igure2.3C. - - -
(*)lml
OfBH
MKLOT
OF3H
RFIFO
OF4H
BCRH1
Of3H
ScsLl
OF2H
(0)B
OFOH
[.)55TAT
O~H
4Amtl
OE3H
PRB3
OE4H
BcRHo
Os3H
KsLo
m?H
(*)A
OEoH
(.) TSTAT
~H
MISKO
O03H
TmcNT
Oo4H
OAXH1
Oo3n
OARLl
C02H
(*)PSW
OooH
(.)12N1
Orm
AcR3
OC3H
BXOFF CuH
w Oc3n
OARLO Oc2H
(*)P4
OCOH
(*)IP OBSH
SLOITM OWH
sARnl
~H
SARL1 OB2H
(9P3
OBOH
(*)IE OABH
ADRl OASH
IFS OA4H
SARHo
OA3H
..DI.
II.*U
(*)P2
I
I I
I I
I
I
OAOH
/////////////////////////////////
OSSH
(*)=F SW I %1 [ SM2 I ECNI TEE i SSS ] n I RI
OBaH
*rlnrl
m..
TLO
OsAH
/////////////////
I’nrn
Im’au
,,.”
—,,
OMooKlclJ(l
Ml[ MO 1 M i CT I PL1 I PLOI PS OB4H
CPH OS3H
m OB2H
-.
OBIH
270427-2
Figure 2.2. Special Function Registers
7-8