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

I need to access two memory of xdata

Hi,
I have two memory (Flash & NVRAM). I need to access both memories.

I am writing program in C. If I want to store some variables in NVRAM and some in Flash how do I do it?

Is there any mechanism (like code if U give it will directly go to code memory) so that I will define NVRAM as my first address of the NVRAM then after that if I declare some variables under NVRAM (like code or Xdata) it will work?

Parents
  • The two memories would occupy different address ranges in the xdata memory space. You would not use two extra keywords.

    The _at_ keyword might come in handy for you. It allows you to place individual variables at particular memory addresses.

    When declaring large amounts of data, it is probably easier to keep the variable in separate files, and use the linker controls to locate the entire segment into flash or NVRAM as Andrew describes.

Reply
  • The two memories would occupy different address ranges in the xdata memory space. You would not use two extra keywords.

    The _at_ keyword might come in handy for you. It allows you to place individual variables at particular memory addresses.

    When declaring large amounts of data, it is probably easier to keep the variable in separate files, and use the linker controls to locate the entire segment into flash or NVRAM as Andrew describes.

Children
No data