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 can I use the on chip ram at 0x100 to 0x2FF?

I used the SM89516A, the cpu have 512 byte ram, but how can i define a variable at 0x100 to 0x2FF? I try to define a variable as idata but it will be located at 0x80 to 0xFF. then I try to define a variable as xdata, but it seem like the variable locate at the off chip ram. so, how can i do?

  • "I used the SM89516A, the cpu have 512 byte ram"

    The Keil Database entry says 1024 bytes:
    http://www.keil.com/dd/chip/3759.htm

    Anyhow, you need to read the Datasheet carefully to determine exactly what it means by this.

    "512 byte ram" could well mean that it has the standard 8052's 256 bytes of DATA/IDATA "internal" RAM, plus a further 256 bytes of on-chip XDATA RAM.
    If that is the case, then the on-chip XDATA address range is 0x00-0xFF - which would explain your observations!

  • Most chip data sheets are poorly written on this point. But most chips operate exactly as Andy says.

    The chip designer often will put a single physical RAM block on the chip, say 1KB or 2KB. RAMs have overhead on the chip, and it's generally cheaper in die area to put in one larger RAM area than to split it into two little ones. But those 8192 bits are used both for (typically) 256 bytes of data/idata space for the 8051 core, and then the rest of the physical memory (768 bytes) is decoded as xdata memory from the point of view of the 8051 core.

    The data sheet, however, will usually list a bullet point along the lines of "2KB of internal RAM", by which they mean internal to the whole chip; that is, not outside the chip package. This is not the same thing as the internal data space of the 8051 processor core.

    There are some 8051 variants where they actually modify the implementation of the processor core itself to address more memory space, but these designs are more rare.