EasyManua.ls Logo

Microchip Technology dsPIC30F - Page 68

Microchip Technology dsPIC30F
738 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
dsPIC30F Family Reference Manual
DS70050C-page 3-8 © 2004 Microchip Technology Inc.
3.3.1 Modulo Start and End Address Selection
Four address registers are available for specifying the modulo buffer start and end addresses:
XMODSRT: X AGU Modulo Start Address Register
XMODEND: X AGU Modulo End Address Register
YMODSRT: Y AGU Modulo Start Address Register
YMODEND: Y AGU Modulo End Address Register
The start address for a modulo buffer must be located at an even byte address boundary. The
LSB of the XMODSRT and YMODSRT registers is fixed at ‘0’ to ensure the correct modulo start
address. The end address for a modulo buffer must be located at an odd byte address boundary.
The LSB of the XMODEND and YMODEND registers is fixed to ‘1’ to ensure the correct modulo
end address.
The start and end address selected for each modulo buffer have certain restrictions, depending
on whether an incrementing or decrementing buffer is to be implemented. For an incrementing
buffer, a W register pointer is incremented through the buffer address range. When the end
address of the incrementing buffer is reached, the W register pointer is reset to point to the start
of the buffer. For a decrementing buffer, a W register pointer is decremented through the buffer
address range. When the start address of a decrementing buffer is reached, the W register
pointer is reset to point to the end of the buffer.
3.3.1.1 Modulo Start Address
The data buffer start address is arbitrary, but must be at a ‘zero’ power of two boundary for
incrementing modulo buffers. The modulo start address can be any value for decrementing
modulo buffers and is calculated using the chosen buffer end address and buffer length.
For example, if the buffer length for an incrementing buffer is chosen to be 50 words (100 bytes),
then the buffer start byte address must contain 7 Least Significant zeros. Valid start addresses
may, therefore, be 0xNN00 and 0xNN80, where ‘N’ is any hexadecimal value.
3.3.1.2 Modulo End Address
The data buffer end address is arbitrary but must be at a ‘ones’ boundary for decrementing
buffers. The modulo end address can be any value for an incrementing buffer and is calculated
using the chosen buffer start address and buffer length.
For example, if the buffer size (modulus value) is chosen to be 50 words (100 bytes), then the
buffer end byte address for decrementing modulo buffer must contain 7 Least Significant ones.
Valid end addresses may, therefore, be 0xNNFF and 0xNN7F, where ‘x’ is any hexadecimal
value.
Note: The user must decide whether an incrementing or decrementing modulo buffer is
required for the application. There are certain address restrictions that depend on
whether an incrementing or decrementing modulo buffer is to be implemented.
Note: If the required modulo buffer length is an even power of 2, modulo start and end
addresses can be chosen that satisfy the requirements for incrementing and
decrementing buffers.

Table of Contents

Other manuals for Microchip Technology dsPIC30F