Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
345
FLASH_Read4_Compact
FLASH_Erase
PIC24 and dsPIC33 Functions 
Prototype
sub procedure FLASH_Read4_Compact(dim flash_address as longint, dim write_to 
as word)
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
dim flash_address as longint
    cArr         as word[8]
    ptr_data     as word
...
flash_address = 0x006000
ptr_data = @cArr
FLASH_Read4_Compact(flash_address, ptr_data)
Notes
The user should take care of the address alignment  (see the explanation  at the beginning  of this 
page).
Prototype
sub procedure FLASH_Erase(dim address as longint)
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 flash memory block, starting from address 0x006400
dim flash_address as longint
...
flash_address = 0x006400
FLASH_Erase(flash_address)
Notes
The user should take care about the address alignment (see the explanation at the beginning of this 
page).