17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

setup_ccp1( ) setup_ccp2( ) setup_ccp3( ) setup_ccp4( )<br />

setup_ccp5( ) setup_ccp6( )<br />

Syntax: setup_ccp1 (mode) or setup_ccp1 (mode, pwm)<br />

setup_ccp2 (mode) or setup_ccp2 (mode, pwm)<br />

setup_ccp3 (mode) or setup_ccp3 (mode, pwm)<br />

setup_ccp5 (mode) or setup_ccp5 (mode, pwm)<br />

setup_ccp6 (mode) or setup_ccp6 (mode, pwm)<br />

Parameters: mode is a constant. Valid constants are defined in the devices .h file and refer<br />

to devices .h file for all options, some options are as follows:<br />

Disable the CCP:<br />

CCP_OFF<br />

Set CCP to capture mode:<br />

CCP_CAPTURE_FE<br />

CCP_CAPTURE_RE<br />

CCP_CAPTURE_DIV_4<br />

CCP_CAPTURE_DIV_16<br />

Capture on falling edge<br />

Capture on rising edge<br />

Capture after 4 pulses<br />

Capture after 16 pulses<br />

Set CCP to compare mode:<br />

CCP_COMPARE_SET_ON_MATCH<br />

CCP_COMPARE_CLR_ON_MATCH<br />

CCP_COMPARE_INT<br />

CCP_COMPARE_RESET_TIMER<br />

Output high on compare<br />

Output low on compare<br />

interrupt on compare<br />

Reset timer on compare<br />

Set CCP to PWM mode:<br />

CCP_PWM<br />

Enable Pulse Width Modulator<br />

Constants used for ECCP modules are as follows:<br />

CCP_PWM_H_H<br />

CCP_PWM_H_L<br />

CCP_PWM_L_H<br />

CCP_PWM_L_L<br />

CCP_PWM_FULL_BRIDGE<br />

CCP_PWM_FULL_BRIDGE_REV<br />

CCP_PWM_HALF_BRIDGE<br />

CCP_SHUTDOWN_ON_COMP1 shutdown on Comparator 1<br />

change<br />

CCP_SHUTDOWN_ON_COMP2 shutdown on Comparator 2<br />

change<br />

CCP_SHUTDOWN_ON_COMP Either Comp. 1 or 2 change<br />

CCP_SHUTDOWN_ON_INT0<br />

VIL on INT pin<br />

282

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!