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.

value=read_program_eeprom(0x1000);<br />

write_program_memory(0x1000,data,8);<br />

read_program_memory(0x1000,value,8);<br />

erase_program_eeprom(0x1000);<br />

write_program_memory(0x1010,data,8);<br />

read_program_memory(0x1000,value,8);<br />

//reads 0x1000 returns 0x1234<br />

//erases 64 bytes starting at 0x1000 as 0x1000 is a multiple<br />

//of 64 and writes 8 bytes from data to 0x1000<br />

//reads 8 bytes to value from 0x1000<br />

//erases 64 bytes starting at 0x1000<br />

//writes 8 bytes from data to 0x1000<br />

//reads 8 bytes to value from 0x1000<br />

For chips where getenv("FLASH_ERASE_SIZE") > getenv("FLASH_WRITE_SIZE")<br />

WRITE_PROGRAM_EEPROM -<br />

Writes 2 bytes,does not erase (use ERASE_PROGRAM_EEPR<br />

WRITE_PROGRAM_MEMORY -<br />

Writes any number of bytes,will erase a block whenever the first<br />

(lowest) byte in a block is written to. If the first address is not th<br />

start of a block that block is not erased.<br />

ERASE_PROGRAM_EEPROM -<br />

Will erase a block. The lowest address bits are not used.<br />

For chips where getenv("FLASH_ERASE_SIZE") = getenv("FLASH_WRITE_SIZE")<br />

WRITE_PROGRAM_EEPROM -<br />

Writes 2 bytes, no erase is needed.<br />

WRITE_PROGRAM_MEMORY -<br />

Writes any number of bytes, bytes outside the range of the write<br />

block are not changed. No erase is needed.<br />

ERASE_PROGRAM_EEPROM -<br />

Not available.<br />

PSP<br />

These options let to configure and use the Parallel Slave Port on the supported devices.<br />

Relevant Functions:<br />

setup_psp(mode)<br />

psp_output_full()<br />

psp_input_full()<br />

psp_overflow()<br />

Enables/disables the psp port on the chip<br />

Returns 1 if the output buffer is full(waiting to be read by the<br />

external bus)<br />

Returns 1 if the input buffer is full(waiting to read by the cpu)<br />

Returns 1 if a write occurred before the previously written byte<br />

was read<br />

Relevant Preprocessor:<br />

62

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

Saved successfully!

Ooh no, something went wrong!