English
Language : 

DSPIC33EPXXXGP50X Datasheet, PDF (101/504 Pages) Microchip Technology – 16-bit Microcontrollers and Digital Signal Controllers (up to 256 KB Flash and 32 KB SRAM) with High-Speed PWM, Op amps, and Advanced Analog
dsPIC33EPXXXGP50X, dsPIC33EPXXXMC20X/50X, AND PIC24EPXXXGP/MC20X
Allocating different page registers for read and write
access allows the architecture to support data
movement between different pages in data memory.
This is accomplished by setting the DSRPAG register
value to the page from which you want to read, and
configuring the DSWPAG register to the page to which
it needs to be written. Data can also be moved from
different PSV to EDS pages, by configuring the
DSRPAG and DSWPAG registers to address PSV and
EDS space, respectively. The data can be moved
between pages by a single instruction.
When an EDS or PSV page overflow or underflow
occurs, EA<15> is cleared as a result of the register
indirect EA calculation. An overflow or underflow of the
EA in the EDS or PSV pages can occur at the page
boundaries when:
• The initial address prior to modification addresses
an EDS or PSV page
• The EA calculation uses pre- or post-modified
register indirect addressing. However, this does
not include register offset addressing
In general, when an overflow is detected, the DSxPAG
register is incremented, and the EA<15> bit is set to
keep the base address within the EDS or PSV window.
When an underflow is detected, the DSxPAG register is
decremented, and the EA<15> bit is set to keep the
base address within the EDS or PSV window. This
creates a linear EDS and PSV address space, but only
when using Register Indirect Addressing modes.
Exceptions to the operation described above arise
when entering and exiting the boundaries of page 0,
EDS, and PSV spaces. Table 4-61 lists the effects of
overflow and underflow scenarios at different
boundaries.
In the following cases, when overflow or underflow
occurs, the EA<15> bit is set and the DSxPAG is not
modified; therefore, the EA will wrap to the beginning of
the current page:
• Register indirect with register offset addressing
• Modulo Addressing
• Bit-reversed addressing
TABLE 4-61: OVERFLOW AND UNDERFLOW SCENARIOS AT PAGE 0, EDS, and PSV SPACE
BOUNDARIES
O/U,
R/W
Operation
DSxPAG
Before
DS
EA<15>
Page
Description
DSxPAG
After
DS
EA<15>
Page
Description
O,
Read
DSRPAG = 0x1FF
1 EDS: Last page DSRPAG = 0x1FF
0 See Note 1
O,
Read
O,
Read
[++Wn]
or
[Wn++]
DSRPAG = 0x2FF
DSRPAG = 0x3FF
1 PSV: Last lsw DSRPAG = 0x300
page
1 PSV: Last MSB DSRPAG = 0x3FF
page
1 PSV: First MSB
page
0 See Note 1
O,
Write
DSWPAG = 0x1FF 1 EDS: Last page DSWPAG = 0x1FF 0 See Note 1
U,
Read
U,
Read
U,
Read
[--Wn]
or
[Wn--]
DSRPAG = 0x001
DSRPAG = 0x200
DSRPAG = 0x300
1 PSV page
DSRPAG = 0x001
1 PSV: First lsw DSRPAG = 0x200
page
1 PSV: First MSB DSRPAG = 0x2FF
page
0 See Note 1
0 See Note 1
1 PSV: Last lsw
page
Legend: O = Overflow, U = Underflow, R = Read, W = Write
Note 1: The register indirect address now addresses a location in the base data space (0x0000-0x8000).
2: An EDS access with DSxPAG = 0x000 will generate an address error trap.
3: Only reads from PS are supported using DSRPAG. An attempt to write to PS using DSWPAG will generate
an address error trap.
4: Pseudo-linear addressing is not supported for large offsets.
© 2011 Microchip Technology Inc.
Preliminary
DS70657D-page 101