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.

Functional Overview<br />

Configuration Memory<br />

On all PIC18 Family of chips, the configuration memory is readable and writable. This<br />

functionality is not available on the PIC16 Family of devices..<br />

Relevant Functions:<br />

write_configuration_memory<br />

(ramaddress, count)<br />

or<br />

write_configuration_memory<br />

(offset,ramaddress, count)<br />

read_configuration_memory<br />

(ramaddress,count)<br />

Writes count bytes, no erase needed<br />

Writes count bytes, no erase needed starting at byte<br />

address offset<br />

Read count bytes of configuration memory<br />

Relevant Preprocessor:<br />

None<br />

Relevant Include Files:<br />

None, all functions built-in<br />

Relevant getenv() parameters:<br />

None<br />

Example Code:<br />

For PIC18f452<br />

int16 data=0xc32;<br />

...<br />

write_configuration_memory(data,2); //writes 2 bytes to the configuration memory<br />

DAC<br />

These options let the user configure and use the digital to analog converter module. They are<br />

only available on devices with the DAC hardware. The options for the functions and directives<br />

vary depending on the chip and are listed in the device header file.<br />

Relevant Functions:<br />

setup_dac(divisor)<br />

Sets up the DAC e.g. Reference voltages<br />

dac_write(value)<br />

Writes the 8-bit value to the DAC module<br />

49

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

Saved successfully!

Ooh no, something went wrong!