English
Language : 

C508_01 Datasheet, PDF (32/267 Pages) Infineon Technologies AG – 8-Bit CMOS Microcontroller
C508
Memory Organization
Port 0
Address/Data
XPAGE
Write I/O Data
to Port 2
Port 2
XRAM
I/O-Data
MCB02114
Figure 3-4 Use of Port 2 as I/O Port
With a write to Port 2, the XRAM address in XPAGE register will be overwritten because
of the concurrent write to Port 2 and the XPAGE register. So, whenever XRAM is used
and the XRAM address differs from the byte written to the Port 2 latch, it is absolutely
necessary to rewrite XPAGE with the page address.
Example:
I/O data at Port 2 shall be AAH. A byte shall be fetched from XRAM at address FF30H.
MOV R0, #30H
;
MOV P2, #0AAH
; P2 shows AAH and XPAGE contains AAH
MOV XPAGE, #0FFH ; P2 still shows AAH but XRAM is addressed
MOVX A, @R0
; the contents of XRAM at FF30H is moved to the accumulator
User’s Manual
3-8
2001-05