17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example<br />

Files:<br />

Also See:<br />

None<br />

This function sets the compare value for the output compare module. If the<br />

output compare module is to perform only a single compare than the ocrs<br />

register is not used. If the output compare module is using double compare to<br />

generate an output pulse, the ocr signifies the start of the pulse and ocrs<br />

defines the pulse termination time.<br />

Only available on devices with output compare modules.<br />

Nothing<br />

// Pin OC1 will be set when timer 2 is equal to 0xF000<br />

setup_timer2(TMR_INTERNAL | TIMER_DIV_BY_8);<br />

setup_compare_time(1, 0xF000);<br />

setup_compare(1, COMPARE_SET_ON_MATCH | COMPARE_TIMER2);<br />

None<br />

get_capture( ), setup_compare( ), Output Compare, PWM Overview<br />

set_nco_inc_value( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

set_nco_inc_value(value);<br />

value- 16-bit value to set the NCO increment registers to<br />

(0 - 65535)<br />

Undefined<br />

Sets the value that the NCO's accumulator will be<br />

incremented by on each clock pulse. The increment<br />

registers are double buffered so the new value won't be<br />

applied until the accumulator rolls-over.<br />

On devices with a NCO module.<br />

Examples:<br />

set_nco_inc_value(inc_value); //sets the new increment value<br />

Example<br />

Files:<br />

Also See:<br />

None<br />

setup_nco( ), get_nco_accumulator( ), get_nco_inc_value(<br />

)<br />

Syntax:<br />

set_open_drain_a(value)<br />

set_open_drain_b(value)<br />

270

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

Saved successfully!

Ooh no, something went wrong!