Datasheet

dsPIC33FJ12GP201/202
DS70264E-page 32 © 2007-2011 Microchip Technology Inc.
4.1.1 PROGRAM MEMORY
ORGANIZATION
The program memory space is organized in
word-addressable blocks. Although it is treated as
24 bits wide, it is more appropriate to think of each
address of the program memory as a lower and upper
word, with the upper byte of the upper word being
unimplemented. The lower word always has an even
address, while the upper word has an odd address
(Figure 4-2).
Program memory addresses are always word-aligned
on the lower word, and addresses are incremented or
decremented by two during code execution. This
arrangement provides compatibility with data memory
space addressing and makes data in the program
memory space accessible.
4.1.2 INTERRUPT AND TRAP VECTORS
All dsPIC33FJ12GP201/202 devices reserve the
addresses between 0x00000 and 0x000200 for
hard-coded program execution vectors. A hardware
Reset vector is provided to redirect code execution
from the default value of the PC on device Reset to the
actual start of code. A GOTO instruction is programmed
by the user application at 0x000000, with the actual
address for the start of code at 0x000002.
dsPIC33FJ12GP201/202 devices also have two
interrupt vector tables, located from 0x000004 to
0x0000FF and 0x000100 to 0x0001FF. These vector
tables allow each of the many device interrupt sources
to be handled by separate Interrupt Service Routines
(ISRs). A more detailed discussion of the interrupt
vector tables is provided in Section 7.1 “Interrupt
Vector Table.
4.2 Data Address Space
The dsPIC33FJ12GP201/202 CPU has a separate
16-bit-wide data memory space. The data space is
accessed using separate Address Generation Units
(AGUs) for read and write operations. The data
memory map is shown in Figure 4-3.
All Effective Addresses (EAs) in the data memory
space are 16 bits wide and point to bytes within the
data space. This arrangement gives a data space
address range of 64 Kbytes or 32K words. The lower
half of the data memory space (that is, when
EA<15> = 0) is used for implemented memory
addresses, while the upper half (EA<15> = 1) is
reserved for the Program Space Visibility area (see
Section 4.6.3 “Reading Data From Program Mem-
ory Using Program Space Visibility”).
Microchip dsPIC33FJ12GP201/202 devices implement
up to 1 Kbyte of data memory. Should an EA point to a
location outside of this area, an all-zero word or byte
will be returned.
4.2.1 DATA SPACE WIDTH
The data memory space is organized in byte address-
able, 16-bit-wide blocks. Data is aligned in data
memory and registers as 16-bit words, but all data
space EAs resolve to bytes. The Least Significant
Bytes (LSBs) of each word have even addresses, while
the Most Significant Bytes (MSBs) have odd
addresses.
FIGURE 4-2: PROGRAM MEMORY ORGANIZATION
0816
PC Address
0x000000
0x000002
0x000004
0x000006
23
00000000
00000000
00000000
00000000
Program Memory
‘Phantom’ Byte
(read as ‘0’)
least significant word (lsw)
most significant word (msw)
Instruction Width
0x000001
0x000003
0x000005
0x000007
msw
Address (lsw Address)