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

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:
#use fast_io(b)
...
Int8 Tris_value= 0x0F;
int1 Pin_value;
...
set_tris_b(Tris_value);
output_high(PIN_B7);
If(input(PIN_B0)){
output_high(PIN_B7)
;}
Input Capture
These functions allow for the configuration of the input capture module. The timer source for the
input capture operation can be set to either Timer 2 or Timer 3. In capture mode the value of the
selected timer is copied to the ICxBUF register when an input event occurs and interrupts can be
configured to fire as needed.
Relevant Functions:
setup_capture(x, mode)
get_capture(x, wait)
Relevant Preprocessor:
None
Relevant Interrupts:
INT_ICx
Relevant Include Files:
None, all functions built-in.
Relevant getenv() parameters:
None
Example Code:
setup_timer3(TMR_INTERNAL | TMR_DIV_BY_8);
setup_capture(2, CAPTURE_FE | CAPTURE_TIMER3);
while(TRUE) {
}
timerValue = get_capture(2, TRUE);
printf(“A module 2 capture event occurred at: %LU”, timerValue;
Sets the operation mode of the input capture module x
Reads the capture event time from the ICxBUF result register. If wait is
true, program flow waits until a new result is present. Otherwise the
oldest value in the buffer is returned.
Interrupt fires on capture event as configured
//Sets B0:B3 as
//Set the pin B7 to High
//Read the value on pin B0, set B7 to low if pin
B0 is high
input and B4:B7 as output
67

Related parts for PCDIDE COMPILER