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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.1 INTRODUCTION<br />

4.2 HIGHLIGHTS<br />

4.3 ADDRESS SPACES<br />

<strong>MPLAB</strong> ® C COMPILER FOR<br />

<strong>PIC24</strong> <strong>MCUs</strong> AND <strong>dsPIC</strong> ® <strong>DSCs</strong><br />

USER’S GUIDE<br />

Chapter 4. Run Time Environment<br />

This section discusses the <strong>MPLAB</strong> C <strong>Compiler</strong> <strong>for</strong> <strong>PIC24</strong> <strong>MCUs</strong> <strong>and</strong> <strong>dsPIC</strong> ® <strong>DSCs</strong><br />

(<strong>for</strong>merly <strong>MPLAB</strong> C30) run-time environment.<br />

Items discussed in this chapter are:<br />

• Address Spaces<br />

• Startup <strong>and</strong> Initialization<br />

• Memory Spaces<br />

• Memory Models<br />

• Locating Code <strong>and</strong> Data<br />

• Software Stack<br />

• The C Stack Usage<br />

• The C Heap Usage<br />

• Function Call Conventions<br />

• Register Conventions<br />

• Bit Reversed <strong>and</strong> Modulo Addressing<br />

• Program Space Visibility (PSV) Usage<br />

The <strong>dsPIC</strong> Digital Signal Controller (DSC) devices are a combination of traditional PIC ®<br />

Microcontroller (MCU) features (peripherals, Harvard architecture, RISC) <strong>and</strong> new<br />

DSP capabilities. The <strong>dsPIC</strong> DSC devices have two distinct memory regions:<br />

• Program Memory contains executable code <strong>and</strong> optionally constant data.<br />

• Data Memory contains external variables, static variables, the system stack <strong>and</strong><br />

file registers. Data memory consists of near data, which is memory in the first 8<br />

KB of the data memory space, <strong>and</strong> far data, which is in the upper 56 KB of data<br />

memory space.<br />

Although the program <strong>and</strong> data memory regions are distinctly separate, the compiler<br />

can access constant data in program memory through the program space visibility<br />

window.<br />

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

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

Saved successfully!

Ooh no, something went wrong!