PCDIDE COMPILER Custom Computer Services Inc (CCS), PCDIDE COMPILER Datasheet - Page 354

PCD C-COMPILER PIC24, DSPIC

PCDIDE COMPILER

Manufacturer Part Number
PCDIDE COMPILER
Description
PCD C-COMPILER PIC24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet

Specifications of PCDIDE COMPILER

For Use With/related Products
Microchip PIC24/dsPIC®
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1008
PCD C Compiler Reference Manual January 2011
What can be done about an OUT OF RAM error?
The compiler makes every effort to optimize usage of RAM. Understanding the RAM allocation can
be a help in designing the program structure. The best re-use of RAM is accomplished when local
variables are used with lots of functions. RAM is re-used between functions not active at the same
time. See the NOT ENOUGH RAM error message in this manual for a more detailed example.
RAM is also used for expression evaluation when the expression is complex. The more complex
the expression, the more scratch RAM locations the compiler will need to allocate to that
expression. The RAM allocated is reserved during the execution of the entire function but may be
re-used between expressions within the function. The total RAM required for a function is the sum
of the parameters, the local variables and the largest number of scratch locations required for any
expression within the function. The RAM required for a function is shown in the call tree after the
RAM=. The RAM stays used when the function calls another function and new RAM is allocated for
the new function. However when a function RETURNS the RAM may be re-used by another
function called by the parent. Sequential calls to functions each with their own local variables is
very efficient use of RAM as opposed to a large function with local variables declared for the entire
process at once.
Be sure to use SHORT INT (1 bit) variables whenever possible for flags and other boolean
variables. The compiler can pack eight such variables into one byte location. The compiler does
this automatically whenever you use SHORT INT. The code size and ROM size will be smaller.
Finally, consider an external memory device to hold data not required frequently. An external 8 pin
EEPROM or SRAM can be connected to the PIC® with just 2 wires and provide a great deal of
additional storage capability. The compiler package includes example drivers for these
devices. The primary drawback is a slower access time to read and write the data. The SRAM will
have fast read and write with memory being lost when power fails. The EEPROM will have a very
long write cycle, but can retain the data when power is lost.
340

Related parts for PCDIDE COMPILER