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.

PreProcessor<br />

remappable pin to first available module.<br />

Selects timer to use with PWM module, default if not specified is timer<br />

TIMER=x<br />

2.<br />

Sets the period of PWM based off specified value, should not be used<br />

if PERIOD is already specified. If frequency can't be achieved exactly<br />

compiler will generate a message specifying the exact frequency and<br />

period of PWM. If neither FREQUENCY or PERIOD is specified, the<br />

period defaults to maximum possible period with maximum resolution<br />

FREQUENCY=x<br />

and compiler will generate a message specifying the frequency and<br />

period of PWM, or if using same timer as previous stream instead of<br />

setting to maximum possible it will be set to the same as previous<br />

stream. If using same timer as previous stream and frequency is<br />

different compiler will generate an error.<br />

Sets the period of PWM, should not be used if FREQUENCY is already<br />

specified. If period can't be achieved exactly compiler will generate a<br />

message specifying the exact period and frequency of PWM. If neither<br />

PERIOD or FREQUENCY is specified, the period defaults to maximum<br />

PERIOD=x<br />

possible period with maximum resolution and compiler will generate a<br />

message specifying the frequency and period of PWM, or if using<br />

same timer as previous stream instead of setting to maximum possible<br />

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

previous stream and period is different compiler will generate an error.<br />

Sets the resolution of the the duty cycle, if period or frequency is<br />

specified will adjust the period to meet set resolution and will generate<br />

an message specifying the frequency and duty of PWM. If period or<br />

frequency not specified will set period to maximum possible for<br />

BITS=x<br />

specified resolution and compiler will generate a message specifying<br />

the frequency and period of PWM, unless using same timer as<br />

previous then it will generate an error if resolution is different then<br />

previous stream. If not specified then frequency, period or previous<br />

stream using same timer sets the resolution.<br />

DUTY=x Selects the duty percentage of PWM, default if not specified is 50%.<br />

Associates a stream identifier with the PWM signal. The identifier may<br />

STREAM=id<br />

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

Purpose:<br />

Example Files<br />

Also See:<br />

This directive tells the compiler to setup a PWM on the specified pin<br />

using the specified frequency, period, duty cycle and resolution. The<br />

#USE DELAY directive must appear before this directive can be used.<br />

This directive enables use of built-in functions such as<br />

set_pwm_duty_percent(), set_pwm_frequency(), set_pwm_period(),<br />

pwm_on() and pwm_off().<br />

None<br />

#use rs232<br />

Syntax:<br />

#USE RS232 (options)<br />

139

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

Saved successfully!

Ooh no, something went wrong!