
C165UTAH
Memory Organization
Data Sheet
52
2001-02-23
Special Function Registers
The functions of the CPU, the bus interface, the I/O ports and the on-chip peripherals of
the C165UTAH are controlled via a number of so-called Special Function Registers
(SFRs). These SFRs are arranged within two areas of 512 Byte size each. The first
register block, the SFR area, is located in the 512 Bytes above the internal RAM
(00’FFFF
H
...00’FE00
H
), the second register block, the Extended SFR (ESFR) area, is
located in the 512 Bytes below the internal RAM (00’F1FF
H
...00’F000
H
).
Special function registers can be addressed via indirect and long 16-bit addressing
modes. Using an 8-bit offset together with an implicit base address allows to address
word SFRs and their respective low bytes. However, this
does not work
for the
respective high bytes!
Note:
Writing to any byte of an SFR causes the non-addressed complementary byte to
be cleared!
The upper half of each register block is bit-addressable, so the respective control/status
bits can directly be modified or checked using bit addressing.
When accessing registers in the ESFR area using 8-bit addresses or direct bit
addressing, an Extend Register (EXTR) instruction is required before, to switch the short
addressing mechanism from the standard SFR area to the Extended SFR area. This is
not required for 16-bit and indirect addresses. The GPRs R15...R0 are duplicated, ie.
they are accessible within both register blocks via short 2-, 4- or 8-bit addresses without
switching.
ESFR_SWITCH_EXAMPLE:
EXTR
MOV
BFLDL
BSET
MOV
#4
ODP2, #data16
DP6, #mask, #data8
DP1H.7
T8REL, R1
;Switch to ESFR area for next 4 instr.
;ODP2 uses 8-bit reg addressing
;Bit addressing for bit fields
;Bit addressing for single bits
;T8REL uses 16-bit mem address,
;R1 is duplicated into the ESFR space
;(EXTR is not required for this access)
;----
;-------------------
;The scope of the EXTR #4 instruction...
;...ends here!
MOV
T8REL, R1
;T8REL uses 16-bit mem address,
;R1 is accessed via the SFR space