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

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
COMMON QUESTIONS AND ANSWERS
How do I directly read/write to internal registers?
A hardware register may be mapped to a C variable to allow direct read and write capability to the
register. The following is an example using the TIMER0 register:
#BYTE timer 1 = 0x 100
timer0= 128; //set timer0 to 128
while (timer 1 ! = 200); // wait for timer0 to reach 200
Bits in registers may also be mapped as follows:
#BIT T 1 IF = 0x 84.3
.
.
.
while (!T 1 IF); //wait for timer0 interrupt
Registers may be indirectly addressed as shown in the following example:
printf ("enter address:");
a = gethex ();
printf
("\r\n value is %x\r\n", *a);
The compiler has a large set of built-in functions that will allow one to perform the most common
tasks with C function calls. When possible, it is best to use the built-in functions rather than directly
write to registers. Register locations change between chips and some register operations require a
specific algorithm to be performed when a register value is changed. The compiler also takes into
account known chip errata in the implementation of the built-in functions. For example, it is better to
do set_tris_ B (0); rather than *0x 02C6 =0;
331

Related parts for PCDIDE COMPILER