User manual

mikroC PRO for dsPIC
MikroElektronika
369
FLASH_Read4_Compact
FLASH_Erase
PIC24 and dsPIC33 Functions
Prototype
void* FLASH_Read4_Compact(unsigned long address, void *write_to);
Description Reads one latch row (4 instructions, 8 addresses) in the “compact” mode.
Parameters - address: starting address of the FLASH memory block to be read
- write_to: starting address of RAM buffer for storing read data
Returns Starting address of RAM buffer for storing read data.
Requires Nothing.
Example
//--- reads 12 bytes (4 words) from location 0x006000 and stores it to
*pv1;
unsigned int *pv1;
...
FLASH_Read4_Compact(0x006000, pv1);
Notes The user should take care of the address alignment (see the explanation at the beginning of this
page).
Prototype
void FLASH_Erase(unsigned long address);
Description Erases one block (512 instructions, 1024 addresses, 1536 bytes) from the program FLASH memory.
Parameters - address: starting address of the FLASH memory block
Returns Nothing.
Requires Nothing.
Example
//--- erase the ash memory block, starting from address 0x006400
unsigned long ash_address = 0x006400;
...
FLASH_Erase(ash_address);
Notes The user should take care about the address alignment (see the explanation at the beginning of this
page).