Addressing External Memory

Hello,

BASE_ADDR = 0x8000
i=1

A)may I know what is
#define COMMAND(i) (*((volatile char xdata *)(BASE_ADDR +i)))

B)Is is better to address the "command register" of an external chip as XDATA of 8051 chip(using ALE,Port0,Port2,etc) or should I just manually arrange some I/O pins (of 8051) to do that?

Regards,
KC

Parents
  • Is is better to address the "command register" of an external chip as XDATA of 8051 chip(using ALE,Port0,Port2,etc)
    This is memory-mapped I/O.
    or should I just manually arrange some I/O pins (of 8051) to do that?
    This is I/O mapped I/O.
    None is "better" than the other, the general consensus is that if P1 and a couple of P3 pins can handle your I/O you go I/O mapped, if not you go memory mapped.
    The event of "memory rich" chips such as the p89c668 with 8k RAM and 64k FLASH inside the chip has given the possibility of much more I/O mapped I/O since this frees P0 and P2 for I/O.

    Erik

Reply
  • Is is better to address the "command register" of an external chip as XDATA of 8051 chip(using ALE,Port0,Port2,etc)
    This is memory-mapped I/O.
    or should I just manually arrange some I/O pins (of 8051) to do that?
    This is I/O mapped I/O.
    None is "better" than the other, the general consensus is that if P1 and a couple of P3 pins can handle your I/O you go I/O mapped, if not you go memory mapped.
    The event of "memory rich" chips such as the p89c668 with 8k RAM and 64k FLASH inside the chip has given the possibility of much more I/O mapped I/O since this frees P0 and P2 for I/O.

    Erik

Children
More questions in this forum