HEFwriteBlock

Syntax:

    HEFwriteBlock(Flash_row, buffer(), count)

Command availability:

Available on specific Microchip PIC microcontrollers only. Check your datasheet.

Explanation:

Flash_row is the HEFM relative location (i.e. the row number)
Buffer() is the source byte array
Count is the number of bytes to be copied

HEFwriteBlock writes information to the HEFM on chips that support this feature. buffer is a byte array of length equal to count. Writing starts at the beginning of the given row number.

WARNING:

Be aware that this subroutine will first erase whatever data are present on the destination row. If you want to preserve them check the HEFwrite subroutine.

Example:

    #chip 16F1509, 8
    'The following example generates a byte vector and stores it
    'in row 0 of the HEFM of the 16F1509
    dim data(32)
    for index = 1 to 32
      data(index)=index
    next
    HEFwriteBlock(0,data,HEFLASH_ROWSIZE)

    'Now we store a string in row 1
    Dim Hello as String
    Hello="Hello GCB World!"
    HEFwriteBlock(1,Hello,len(Hello))