SW006012 Microchip Technology, SW006012 Datasheet - Page 85

C COMPILER FOR DSPIC30F FAMILY

SW006012

Manufacturer Part Number
SW006012
Description
C COMPILER FOR DSPIC30F FAMILY
Manufacturer
Microchip Technology
Type
MPLAB® C30 Compilerr
Series
PIC24 & DsPICr
Datasheets

Specifications of SW006012

Supported Families
PIC24, DsPIC30F And DsPIC33F
Core Architecture
PIC, DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Tool Type
Compiler
Processor Series
PIC24, dsPIC
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
dsPIC30F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
4.14
4.15
© 2007 Microchip Technology Inc.
BIT REVERSED AND MODULO ADDRESSING
PROGRAM SPACE VISIBILITY (PSV) USAGE
MPLAB C30 C Compiler Runtime Environment
The compiler does not directly support the use of bit reversed and modulo addressing.
If either of these addressing modes is enabled for a register, then it is the programmer’s
responsibility to ensure that the compiler does not use that register as a pointer.
Particular care must be exercised if interrupts can occur while one of these addressing
modes is enabled.
It is possible to define arrays in C that will be suitably aligned in memory for modulo
addressing by assembly language functions. The aligned attribute may be used to
define arrays that are positioned for use as incrementing modulo buffers. The reverse
attribute may be used to define arrays that are positioned for use as decrementing
modulo buffers. For more information on these attributes, see Section 2.3 “Keyword
Differences”. For more information on modulo addressing, see chapter 3 of the
“dsPIC30F Family Reference Manual” (DS70046).
By default, the compiler will automatically arrange for strings and const-qualified
initialized variables to be allocated in the .const section, which is mapped into the
PSV window. Then PSV management is left up to compiler management, which does
not move it, limiting the size of accessible program memory to the size of the PSV
window itself.
Alternatively, an application may take control of the PSV window for its own purposes.
The advantage of directly controlling the PSV usage in an application is that it affords
greater flexibility than having a single .const section permanently mapped into the
PSV window. The disadvantage is that the application must manage the PSV control
registers and bits. Specify the -mconst-in-data option to direct the compiler not to
use the PSV window.
The space attribute can be used to define variables that are positioned for use in the
PSV window. To specify certain variables for allocation in the compiler-managed
section .const, use attribute space(auto_psv). To allocate variables for PSV
access in a section not managed by the compiler, use attribute space(psv). For more
information on these attributes, see Section 2.3 “Keyword Differences”.
For more on PSV usage, see the “MPLAB
User’s Guide” (DS51317).
4.15.1
Two new psv constant sections will be defined: .boot_const and .secure_const.
These sections are analogous to the generic section .const, except that the compiler
uses them independently of the user-selectable constants memory model.
Regardless of whether you have selected the constants-in-code or constants-in-data
memory model, the compiler will create and manage psv constant sections as needed
for secure segments. Consequently, PSVPAG and CORCONbits. PSV must become
compiler managed resources. Support for user-managed PSV sections is maintained
through an object compatibility model explained below.
Upon entrance to a boot or secure function, PSVPAG will be set to the correct value.
This value will be restored after any external function call.
4.15.2
In addition to being used as initializers, string literals may also be used as function
arguments. For example:
myputs("Enter the Dragon code:\n");
Boot and Secure Constants
String Literals as Arguments
®
ASM30, MPLAB
®
LINK30 and Utilities
DS51284F-page 79

Related parts for SW006012