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.

detect is also available in the device<br />

LVD_TRIGGER_BELOW, LVD_TRIGGER_ABOVE<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires<br />

undefined<br />

This function controls the high/low voltage detect module in the device.<br />

The mode constants specifies the voltage trip point and a direction of<br />

change from that point (available only if high voltage detect module is<br />

included in the device). If the device experiences a change past the trip<br />

point in the specified direction the interrupt flag is set and if the interrupt<br />

is enabled the execution branches to the interrupt service routine.<br />

This function is only available with devices that have the high/low<br />

voltage detect module.<br />

Constants are defined in the devices.h file.<br />

Examples:<br />

setup_low_volt_detect( LVD_TRIGGER_BELOW | LVD_36 );<br />

This would trigger the interrupt when the voltage is below 3.6 volts<br />

setup_nco( )<br />

Syntax:<br />

Parameters:<br />

setup_nco(settings,inc_value)<br />

settings- setup of the NCO module. See the device's .h file for all options.<br />

Some typical options include:<br />

· NCO_ENABLE<br />

· NCO_OUTPUT<br />

· NCO_PULSE_FREQ_MODE<br />

· NCO_FIXED_DUTY_MODE<br />

inc_value- int16 value to increment the NCO 20 bit accumulator by.<br />

Returns:<br />

Function:<br />

Availability:<br />

Examples:<br />

Example Files:<br />

Undefined<br />

Sets up the NCO module and sets the value to increment the 20-bit accumulator b<br />

On devices with a NCO module.<br />

setup_nco(NCO_ENABLED|NCO_OUTPUT|NCO_FIXED_DUTY_MODE|<br />

NCO_CLOCK_FOSC,8192);<br />

None<br />

Also See: get_nco_accumulator( ), set_nco_inc_value( ), get_nco_inc_value( )<br />

292

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

Saved successfully!

Ooh no, something went wrong!