Mikroelektronika MIKROE-724 データシート

ページ / 726
340
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
FLASH_Erase32
FLASH_Write_Block
Prototype
sub procedure FLASH_Erase32(dim flash_address as 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
sub  procedure  FLASH_Write_Block(dim  flash_address  as  longint,  dim  data_
address as 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 
flash_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 first, 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
dim flash_address as longint
    cArr          as string[4]
    ptr_data      as word
...
flash_address = 0x006000
cArr = “ABCD”
ptr_data = @cArr
FLASH_Write_Block(flash_address, ptr_data)
Notes
The user should take care about the address alignment (see the explanation at the beginning of this 
page).
dsPIC30 Functions