User manual

344
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
FLASH_Write_DoWrite
FLASH_Read4
Prototype
sub procedure FLASH_Write_DoWrite()
Description Commits the FLASH write operation.
Parameters None.
Returns Nothing.
Requires The block to be written to must be erased rst, either from the user code FLASH_Erase32, 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!
This function is used as a part of the Flash write sequence, therefore FLASH_Write_Init and certain
number of FLASH_Write_Loadlatch4 or FLASH_Write_Loadlatch4_Compact function calls must be
made before this one.
This function is to be called once, at the and of the FLASH write sequence.
Example
const iArr as word[8] = (“m”, “i”, “k”, “r”, “o”, “E”, “l”, “e”)
dim ptr_data as word
...
ptr_data = @iArr
FLASH_Write_Init(0x006100, ptr_data)
FLASH_Write_Loadlatch4()
FLASH_Write_Loadlatch4()
FLASH_Write_DoWrite()
Notes None.
Prototype
sub procedure FLASH_Read4(dim ash_address as longint, dim write_to as
word)
Description Reads one latch row (4 instructions, 8 addresses) in the “regular” 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 ash_address as longint
cArr as word[4]
ptr_data as word
...
ash_address = 0x006000
ptr_data = @cArr
FLASH_Read4(ash_address, ptr_data)
Notes The user should take care of the address alignment (see the explanation at the beginning of this
page).