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

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
When a setting such as a pre-processor directive is included in the main include file between the
units, a library is created in each of the units. The linker is able to determine that the libraries are
duplicates and removes them during the final linking process.
When building a project, each unit being used in the project has its own error file. When using a
*.bat file to do the unit compilations, it may be useful to terminate the process on the first error.
Example
Here is a sample program with explanation using CCS C to read adc samples over rs232:
#if defined(__PCM__)
#include <16F877.h>
PIC16F877
#fuses HS,NOWDT,NOPROTECT,NOLVP
the chip
#use delay(clock=20000000)
speed
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) // preprocessor directive that includes the rs232
libraries
#elif defined(__PCH__)
PIC18F452
#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#endif
void main() {
}
Using the +CC command option, the compiler will return an error code if the compilation fails.
int i, value, min, max;
printf("Sampling:");
setup_port_a( ALL_ANALOG );
setup_adc( ADC_CLOCK_INTERNAL );
set_adc_channel( 0 );
do {
} while (TRUE);
min=255;
max=0;
for(i=0; i<=30; ++i) {
}
printf("\n\rMin: %2X Max: %2X\n\r",min,max);
delay_ms(100);
value = Read_ADC();
if(value<min)
if(value>max)
min=value;
max=value;
///////////////////////////////////////////////////////
/// This program displays the min and max of 30,
/// comments that explains what the program does, ///
/// and A/D samples over the RS-232 interface.
///////////////////////////////////////////////////////
// preprocessor directive that chooses the compiler
// preprocessor directive that selects the chip
// preprocessor directive that defines fuses for
// preprocessor directive that specifies the clock
// same as above but for the PCH compiler and
// main function
// local variable declaration
// printf function included in the RS232 library
// A/D setup functions- built-in
// A/D setup functions- built-in
// A/D setup functions- built-in
// do while statement
// expression
// for statement
// delay built-in function call
// A/D read functions- built-in
// if statement
// if statement
///
///
29

Related parts for PCDIDE COMPILER