Microchip Technology MA330031 Data Sheet

Page of 530
 2011-2013 Microchip Technology Inc.
DS70000657H-page 115
dsPIC33EPXXXGP50X, dsPIC33EPXXXMC20X/50X AND PIC24EPXXXGP/MC20X
4.6.3
MODULO ADDRESSING 
APPLICABILITY
Modulo Addressing can be applied to the Effective
Address (EA) calculation associated with any W
register. Address boundaries check for addresses
equal to:
• The upper boundary addresses for incrementing 
buffers
• The lower boundary addresses for decrementing 
buffers
It is important to realize that the address boundaries
check for addresses less than, or greater than, the
upper (for incrementing buffers) and lower (for
decrementing buffers) boundary addresses (not just
equal to). Address changes can, therefore, jump
beyond boundaries and still be adjusted correctly.
4.7
Bit-Reversed Addressing
(dsPIC33EPXXXMC20X/50X and 
dsPIC33EPXXXGP50X Devices 
Only)
Bit-Reversed Addressing mode is intended to simplify
data reordering for radix-2 FFT algorithms. It is
supported by the X AGU for data writes only.
The modifier, which can be a constant value or register
contents, is regarded as having its bit order reversed.
The address source and destination are kept in normal
order. Thus, the only operand requiring reversal is the
modifier.
4.7.1
BIT-REVERSED ADDRESSING 
IMPLEMENTATION
Bit-Reversed Addressing mode is enabled when all
these conditions are met:
• BWMx bits (W register selection) in the MODCON 
register are any value other than ‘1111’ (the stack 
cannot be accessed using Bit-Reversed 
Addressing)
• The BREN bit is set in the XBREV register
• The addressing mode used is Register Indirect 
with Pre-Increment or Post-Increment
If the length of a bit-reversed buffer is M = 2
N
 bytes,
the last ‘N’ bits of the data buffer start address must
be zeros. 
XBREV<14:0> is the Bit-Reversed Addressing modi-
fier, or ‘pivot point’, which is typically a constant. In the
case of an FFT computation, its value is equal to half of
the FFT data buffer size. 
When enabled, Bit-Reversed Addressing is executed
only for Register Indirect with Pre-Increment or Post-
Increment Addressing and word-sized data writes. It
does not function for any other addressing mode or for
byte-sized data and normal addresses are generated
instead. When Bit-Reversed Addressing is active, the
W Address Pointer is always added to the address
modifier (XBREVx) and the offset associated with the
Register Indirect Addressing mode is ignored. In
addition, as word-sized data is a requirement, the LSb
of the EA is ignored (and always clear). 
If Bit-Reversed Addressing has already been enabled
by setting the BREN (XBREV<15>) bit, a write to the
XBREV register should not be immediately followed by
an indirect read operation using the W register that has
been designated as the Bit-Reversed Pointer.
Note:
The modulo corrected Effective Address
is written back to the register only when
Pre-Modify or Post-Modify Addressing
mode is used to compute the Effective
Address. When an address offset (such
as [W7 + W2]) is used, Modulo
Addressing correction is performed but
the contents of the register remain
unchanged. 
Note:
All bit-reversed EA calculations assume
word-sized data (LSb of every EA is always
clear). The XBREVx value is scaled
accordingly to generate compatible (byte)
addresses.
Note:
Modulo Addressing and Bit-Reversed
Addressing can be enabled simultaneously
using the same W register, but Bit-
Reversed Addressing operation will always
take precedence for data writes when
enabled.