07.04.2013 Views

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.5 MEMORY SPACES<br />

Run Time Environment<br />

Static <strong>and</strong> external variables are normally allocated in general purpose data memory.<br />

Const-qualified variables will be allocated in general purpose data memory if the<br />

constants-in-data memory model is selected, or in program memory if the<br />

constants-in-code memory model is selected.<br />

The compiler defines several special purpose memory spaces to match architectural<br />

features of 16-bit devices. Static <strong>and</strong> external variables may be allocated in the special<br />

purpose memory spaces through use of the space attribute, described in<br />

Section 2.3.1 “Specifying Attributes of Variables”:<br />

data<br />

General data space. Variables in general data space can be accessed using ordinary<br />

C statements. This is the default allocation.<br />

xmemory - <strong>dsPIC</strong>30F/<strong>dsPIC</strong>33F devices only<br />

X data address space. Variables in X data space can be accessed using ordinary C<br />

statements. X data address space has special relevance <strong>for</strong> DSP-oriented libraries<br />

<strong>and</strong>/or assembly language instructions.<br />

ymemory - <strong>dsPIC</strong>30F/<strong>dsPIC</strong>33F devices only<br />

Y data address space. Variables in Y data space can be accessed using ordinary C<br />

statements. Y data address space has special relevance <strong>for</strong> DSP-oriented libraries<br />

<strong>and</strong>/or assembly language instructions.<br />

prog<br />

General program space, which is normally reserved <strong>for</strong> executable code. Variables in<br />

program space can not be accessed using ordinary C statements. They must be<br />

explicitly accessed by the programmer, usually using table-access inline assembly<br />

instructions, or using the program space visibility window.<br />

auto_psv<br />

A compiler-managed area in program space, designated <strong>for</strong> program space visibility<br />

window access. Variables in this space can be read (but not written) using ordinary C<br />

statements <strong>and</strong> are subject to a maximum of 32K total space allocated.<br />

psv<br />

Program space, designated <strong>for</strong> program space visibility window access. Variables in<br />

PSV space are not managed by the compiler <strong>and</strong> can not be accessed using ordinary<br />

C statements. They must be explicitly accessed by the programmer, usually using<br />

table-access inline assembly instructions, or using the program space visibility window.<br />

Variables in PSV space can be accessed using a single setting of the PSVPAG register.<br />

eedata - <strong>dsPIC</strong>30F/<strong>dsPIC</strong>33F devices only<br />

Data EEPROM space, a region of 16-bit wide non-volatile memory located at high<br />

addresses in program memory. Variables in eedata space can not be accessed using<br />

ordinary C statements. They must be explicitly accessed by the programmer, usually<br />

using table-access inline assembly instructions, or using the program space visibility<br />

window.<br />

dma - <strong>PIC24</strong>H <strong>MCUs</strong>, <strong>dsPIC</strong>33F <strong>DSCs</strong> only<br />

DMA memory. Variables in DMA memory can be accessed using ordinary C statements<br />

<strong>and</strong> by the DMA peripheral.<br />

© 2008 <strong>Microchip</strong> Technology Inc. DS51284H-page 65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!