Download Method


This method is used to download a hex file to a target C8051Fxxx device. After a successful exit from the Download() method, the target C8051xxx will be in a "Halt" state. If the device is left in the "Halt" state, it will not begin code execution until the device is reset by a Power-On reset or by a SetTargetGo() method call.


Syntax
[cs = ] object.Download( _
        sDownloadFile As String, _
        [ bDeviceErase As Boolean, ] _
        [ bDownloadScratchPadSFLE As Boolean, ] _
        [ nBankSelect As Long, ] _
        [ nLockFlash As Boolean ] _
        [ bPersistFlash As Boolean ] _
    )

Parameters
sDownloadFile
    A String containing the full path and filename of the file to be downloaded.
bDeviceErase
    When set to True performs a device erase before the download initiates. If set to
    False the part will not be erased. A device erase will erase the entire contents
    of the device's Flash. The default is False.
bDownloadScratchPadSFLE
    This parameter is only for use with devices that have a Scratchpad FLASH memory block.
    Currently, this includes the C8051F02x, C8051F04x, C8051F06x and C8051F12x devices.
    For all other devices this parameter should be left in it's default state. Set this
    parameter to True in order to download to Scratchpad memory. When accessing
    and downloading to Scratchpad memory the only valid address range is 0x0000 to 0x007F.
    The default is False.
nBankSelect
    This parameter is only for use with C8051F12x devices. For all other devices this
    parameter should be left in it's default state. When using a C8051F12x derivative set
    this parameter to '1', '2', or '3' in order to download to a specific bank. The
    default is '-1'.
nLockFlash
    Set this parameter to True to lock the Flash following the download. If Flash is
    locked, the DLL will no longer be able to connect to the device.
bPersistFlash
    If set to True the contents of flash will be read prior to programming. Flash pages
    are erased prior to programming. If there is any data in Flash on the same pages that
    will be programmed that needs to be preserved then set this parameter to True.

Possible Values
cs
    Long. 16 Bit Checksum.