User manual

364
mikoC PRO for dsPIC
MikroElektronika
FLASH_Erase32
FLASH_Write_Block
Prototype
void FLASH_Erase32(unsigned long address);
Description Erases one block (32 instructions, 64 addresses, 96 bytes)from the program FLASH memory.
Parameters - address: starting address of the FLASH memory block
Returns Nothing.
Requires Nothing.
Example
//--- erase the 32-instruction block, starting from address 0x006000
FLASH_Erase32(0x006000);
Notes The user should take care about the address alignment (see the explanation at the beginning of this
page).
Prototype
void FLASH_Write_Block(unsigned long address, unsigned int *data_);
Description Fills one writeable block of Flash memory (4 instructions, 8 addresses, 12 bytes) in the “regular” mode.
Addresses and data are being mapped 1-on-1. This also means that 3rd byte of each program location
remains unused.
Parameters - address: starting address of the FLASH memory block
- data_: data to be written
Returns Nothing.
Requires The block to be written to must be erased rst, either from the user code (through the RTSP), or during
the programming of MCU. Please note that block size that is to be erased is different from the one that
can be written with this function!
Example
unsigned long ash_address = 0x006000;
unsigned int Buffer[4] = {‘A’, ‘B’, ‘C’, ‘D’};
...
FLASH_Write_Block(ash_address, Buffer);
Notes The user should take care about the address alignment (see the explanation at the beginning of this
page).