Download C Compiler User Manual
Transcript
C Compiler Reference Manual
Built-In Functions
Availability:
Only devices that allow writes to program memory.
Requires
Nothing
Examples:
write_program_eeprom(0,0x2800);
//disables program
Example Files:
ex_load.c, loader.c
Also See:
read_program_eeprom(), read_eeprom(),
write_eeprom(), write_program_memory(),
erase_program_eeprom()
WRITE_PROGRAM_MEMORY( )
Syntax:
write_program_memory( address, dataptr, count );
Parameters:
address is 16 bits on PCM parts and 32 bits on PCH
parts. The least significant bit should always be 0 in
PCM. dataptr is a pointer to one or more bytes count
is a 8 bit integer
Returns:
undefined
Function:
Writes count bytes to program memory from dataptr to
address. This function is most effective when count is a
multiple of FLASH_WRITE_SIZE. Whenever this
function is about to write to a location that is a multiple
of FLASH_ERASE_SIZE then an erase is performed on
the whole block.
Availability:
Only devices that allow writes to program memory.
Requires
Nothing
Examples:
for(i=0x1000;i<=0x1fff;i++) {
value=read_adc();
write_program_memory(i, value, 2);
delay_ms(1000);
}
178