This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to use inter 1k ram of DS89C420 and use the double DPTR!

if i define a varial
eg: int k[500];
but i can't find the keil use the inter
1k ram of ds89c420!

in the ASM sourse I can't find any code about DPTR2!
thank you !

  • The second DPTR is used only within some library routines, such as memcpy(). It is not used by the code generator in "normal" C code.

    The 1K internal RAM on the 89C420 is not a larger "data" area, but rather "xdata" memory that happens to be on the same chip.

    Calling it "external data memory" when it is "internal" to the chip is odd, but the data/xdata distinction comes from the original 8051, and has nothing to do with where the memories are physically located on more modern and more highly-integrated devices. Perhaps it's better to think of the "x" as standing for "extended" instead of "external".

    If you enable the internal memory (with the DME bits in the PMR register), it will overlap the first 1K of the 64k of xdata space. Accesses to this address range will remain on-chip. You would use the memory as you would any xdata.

    You can also map this 1K of RAM into the program space.