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.

On-Off Keying (OOK)<br />

Relevant Functions:<br />

(8 bit or 16 bit depending on the<br />

device)<br />

setup_dsm(mode,source,carrier) Configures the DSM module and selects the source signal and<br />

carrier signals.<br />

setup_dsm(TRUE)<br />

setup_dsm(FALSE)<br />

Enables the DSM module.<br />

Disables the DSM module.<br />

Relevant Preprocessor:<br />

None<br />

Relevant Interrupts:<br />

None<br />

Relevant Include Files:<br />

None, all functions built-in<br />

Relevant getenv() parameters: None<br />

Example Code:<br />

setup_dsm(DSM_ENABLED |<br />

DSM_OUTPUT_ENABLED,<br />

DSM_SOURCE_UART1,<br />

DSM_CARRIER_HIGH_VSS |<br />

DSM_CARRIER_LOW_OC1);<br />

//Enables DSM module with the output enabled and selects<br />

UART1<br />

//as the source signal and VSS as the high carrier signal<br />

and OC1's<br />

//PWM output as the low carrier signal.<br />

if(input(PIN_B0))<br />

setup_dsm(FALSE);<br />

else<br />

setup_dsm(TRUE);<br />

Disable DSM module<br />

Enable DSM module<br />

52

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

Saved successfully!

Ooh no, something went wrong!