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

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
Example Code:
/* Setup timer1 as an external real time clock that increments every 16 clock
cycles */
setup_timer1(T1_EXTERNAL_RTC | T2_DIV_BY_16 );
/* Setup timer2 as a timer that increments on every instruction cycle and has
a period of 0x0100 */
setup_timer2(TMR_INTERNAL, 0x0100);
byte value = 0x00;
value =
get_timer2();
Voltage Reference
These functions configure the voltage reference module. These are available only in the supported chips.
Relevant Functions:
setup_vref(mode| value)
Relevant Preprocessor:
None
Relevant Interrupts:
None
Relevant Include Files:
None, all functions built-in
Relevant getenv() parameters:
VREF
Example Code:
For eg:
For PIC12F675
#INT_COMP //comparator interrupt handler
void isr() {
}
safe_conditions=FALSE;
printf("WARNING!! Voltage level is above 3.6 V. \r\n");
setup_comparator(A1_VR_OUT_ON_A2);
setup_vref(VREF_HIGH|15);
enable_interrupts(INT_COMP);
enable_interrupts(GLOBAL);
//retrieve the current value of timer2
Enables and sets up the internal voltage reference
value.
Constants are defined in the devices .h file.
Returns 1 if the device has VREF
// sets two comparators(A1 and VR and A2 as the
output)
//sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
//enables the comparator interrupt
//enables global interrupts
87

Related parts for PCDIDE COMPILER