11.2.3 Extended Data Space (EDS) Window

Some device families support a new data memory architecture called Extended Data Space (EDS). EDS extends the functionality of the PSV window to access additional pages of RAM as well as memory-mapped peripherals. On an EDS device, the PSVPAG register has been replaced by two registers:

  • DSRPAG for reading from Flash, RAM, etc.
  • DSWPAG for writing to RAM

The operation of the EDS window is analogous to the PSV window. When the page registers are set appropriately, a portion of program memory (or extended data memory) can be accessed in the data address range 0x8000 to 0xFFFF. Unlike the PSV window, the EDS window is always enabled. Another difference is that certain page number ranges imply different address spaces:

EDS Page Range Description
0x001 to 0x1FF read/write access to RAM
0x200 to 0x2FF read-only access to lower 16 bits of program memory
0x300 to 0x3FF read-only access to upper 8 bits of program memory
Note: EDS page 0 is undefined. Application code should not attempt to access the EDS window with a page value of zero. Such access is prohibited and a hardware exception will occur.

The special operators edsoffset() and edspage() are provided to facilitate EDS access from assembly language. Built-in functions __builtin_edsoffset() and __builtin_edspage() are provided to facilitate EDS access from C.

The EDS special operators may be used to access any object in on-chip memory, including local RAM (i.e., RAM located within the first 32K of data address space). Consequently, edsoffset() may return a pointer in the range 0x0 to 0xFFFF. edspage() will return a page value in the range 0x001 to 0x2FF. Page values greater that 0x300 are not currently supported.