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

sram interfacing & c code.

i am using keil microvision 2 . i want to interface 64kb sram with 8051 suggest me
code . i know hardware interfacing but i am confused among xdata ,compact,small,large
memory models suggest me how to use this with example.

Parents
  • "i am confused among xdata, compact, small, large memory models"

    XDATA is not a memory model - it's an address space. Keil uses "XDATA" to mean "memory accessed by using the MOVX instruction"
    So your external SRAM will be all XDATA.
    To have the compiler put variables into XDATA (and, thus, into your external SRAM), define them with the xdata keyword.
    For details, see the C51 Manual

    compact, small, and large are Memory Models.
    The Memory Model defines the default location for variables when you don't explicitly state a memory space.
    It's also where the compiler will put function parameters, etc.
    Again, this is describes in the the C51 Manual

Reply
  • "i am confused among xdata, compact, small, large memory models"

    XDATA is not a memory model - it's an address space. Keil uses "XDATA" to mean "memory accessed by using the MOVX instruction"
    So your external SRAM will be all XDATA.
    To have the compiler put variables into XDATA (and, thus, into your external SRAM), define them with the xdata keyword.
    For details, see the C51 Manual

    compact, small, and large are Memory Models.
    The Memory Model defines the default location for variables when you don't explicitly state a memory space.
    It's also where the compiler will put function parameters, etc.
    Again, this is describes in the the C51 Manual

Children