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

PDATA and XDATA

If I use PDATA for my Stack. will any of my XDATA overlap? or is Keil smart enough to prevent that? Does it mean the RAM(XDATA) I have is 2048 - 256 for pdata?

MCU: AT89C51CC03
Memory Model: Compact

PBPSTACK EQU 1
PBPSTACKTOP EQU 0xFF +1

Parents
  • Jerry;
    I second your choice of an ARM eval kit. But I would like to address a concern already expressed in previous replies to your post.

    Selecting Compact does not speed up the overall access of external memory. It will speed up some access to external memory within the page size of PDATA.

    Selecting Compact allows the Compilier/Linker to assign vars to the PDATA area but if you move the PDATA area beyond the first 256 bytes of external memory then you must handle the high address lines of P2.

    But I will be adding a few things to it and I just want some peace of mind. (Your Post).

    If you add many vars, you will be treading on your stack quickly. Remember, by selecting the Compact model, you are telling Keil Tools to put all your vars in PDATA.

    By selecting the Small Memeory model and explicitly assigning your stack variables to PDATA will, IMHO, result in a little more secure and faster external memory access over all.

    In this manner, your auto vars will be assigned to the DATA memory and your explicitly assigned vars will go to the PDATA area.

    In my years of 8051, I have found the PDATA area only useful for quickly accessing memory mapped I/O where I was controlling P2 for the high address decoding.

    Talking with a number of Keil people at the trade shows, they wished they had never implemented PDATA but it was previously defined by INTEL so they had clients ask "where is my PDATA?".

    All in all, I agree with Andy. If you need to build a pseudo stack you should be using a different MCU.
    Bradford

Reply
  • Jerry;
    I second your choice of an ARM eval kit. But I would like to address a concern already expressed in previous replies to your post.

    Selecting Compact does not speed up the overall access of external memory. It will speed up some access to external memory within the page size of PDATA.

    Selecting Compact allows the Compilier/Linker to assign vars to the PDATA area but if you move the PDATA area beyond the first 256 bytes of external memory then you must handle the high address lines of P2.

    But I will be adding a few things to it and I just want some peace of mind. (Your Post).

    If you add many vars, you will be treading on your stack quickly. Remember, by selecting the Compact model, you are telling Keil Tools to put all your vars in PDATA.

    By selecting the Small Memeory model and explicitly assigning your stack variables to PDATA will, IMHO, result in a little more secure and faster external memory access over all.

    In this manner, your auto vars will be assigned to the DATA memory and your explicitly assigned vars will go to the PDATA area.

    In my years of 8051, I have found the PDATA area only useful for quickly accessing memory mapped I/O where I was controlling P2 for the high address decoding.

    Talking with a number of Keil people at the trade shows, they wished they had never implemented PDATA but it was previously defined by INTEL so they had clients ask "where is my PDATA?".

    All in all, I agree with Andy. If you need to build a pseudo stack you should be using a different MCU.
    Bradford

Children