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.

PreProcessor<br />

#use capture<br />

Syntax:<br />

Elements:<br />

#USE CAPTURE(options)<br />

ICx/CCPx<br />

Which CCP/Input Capture module to us.<br />

INPUT = PIN_xx<br />

Specifies which pin to use. Useful for device with remappable pins,<br />

this will cause compiler to automatically assign pin to peripheral.<br />

TIMER=x<br />

Specifies the timer to use with capture unit. If not specified default to<br />

timer 1 for <strong>PCM</strong> and <strong>PCH</strong> compilers and timer 3 for PCD compiler.<br />

TICK=x<br />

The tick time to setup the timer to. If not specified it will be set to<br />

fastest as possible or if same timer was already setup by a previous<br />

stream it will be set to that tick time. If using same timer as previous<br />

stream and different tick time an error will be generated.<br />

FASTEST<br />

Use instead of TICK=x to set tick time to fastest as possible.<br />

SLOWEST<br />

Use instead of TICK=x to set tick time to slowest as possible.<br />

CAPTURE_RISING<br />

Specifies the edge that timer value is captured on. Defaults to<br />

CAPTURE_RISING.<br />

CAPTURE_FALLING<br />

Specifies the edge that timer value is captured on. Defaults to<br />

CAPTURE_RISING.<br />

CAPTURE_BOTH<br />

PCD only. Specifies the edge that timer value is captured on.<br />

Defaults to CAPTURE_RISING.<br />

PRE=x<br />

Specifies number of rising edges before capture event occurs. Valid<br />

options are 1, 4 and 16, default to 1 if not specified. Options 4 and 16<br />

are only valid when using CAPTURE_RISING, will generate an error<br />

is used with CAPTURE_FALLING or CAPTURE_BOTH.<br />

ISR=x<br />

STREAM=id<br />

Associates a stream identifier with the capture module. The identifier<br />

may be used in functions like get_capture_time().<br />

133

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

Saved successfully!

Ooh no, something went wrong!