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
  • I have two memory (Flash & NVRAM). I need to access both memories.

    If you have to access both all the time I have no suggestion except address decoding, but that will either force you to banking or limit you to 64k total.

    In my case I access SRAM "all the time" and need extremely fast operation at such time. Then, oh say once an hour, I need to read a bit from flash to SRAM and have "plenty of time".

    In this scenario, I have all "standard C" variables ( x = y;) be in SRAM and variables in flash only accessible by functions U8 ReadFlashByte(U32 adderess) and WriteFlashByte(U32 adderess, U8 data).

    Erik

Reply
  • I have two memory (Flash & NVRAM). I need to access both memories.

    If you have to access both all the time I have no suggestion except address decoding, but that will either force you to banking or limit you to 64k total.

    In my case I access SRAM "all the time" and need extremely fast operation at such time. Then, oh say once an hour, I need to read a bit from flash to SRAM and have "plenty of time".

    In this scenario, I have all "standard C" variables ( x = y;) be in SRAM and variables in flash only accessible by functions U8 ReadFlashByte(U32 adderess) and WriteFlashByte(U32 adderess, U8 data).

    Erik

Children
No data