User manual

338
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
FLASH_Erase32
FLASH_Write_Block
Prototype
procedure FLASH_Erase32(ash_address : longint);
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
procedure FLASH_Write_Block(ash_address : longint; data_address : word);
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 - ash_address: starting address of the FLASH memory block
- data_address: 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
var ash_address : longint;
cArr : string[4];
ptr_data : word;
...
ash_address := 0x006000;
cArr := ‘ABCD’;
ptr_data := @cArr;
FLASH_Write_Block(ash_address, ptr_data);
Notes The user should take care about the address alignment (see the explanation at the beginning of this
page).
dsPIC30 Functions