Product Comparison: USB I2C | USB SPI | USB GPIO

USB PIC Bootloader. User Manual


7.3.7. BOOT_READ_ID command

BOOT_READ_ID command is used to read the content of ID Locations of PIC microcontroller.

ID Locations – are eight memory locations of PIC memory microcontroller (200000h-200007h). They can be used to store checksum or other code identification numbers.

Before sending BOOT_READ_ID command you have to fill in boot_cmd_read_id structure:

typedef struct
{
   unsigned char cmd;  /* command code, see BOOT_xxx constants */
   unsigned char echo;  /* echo is used to link between command and response */
} boot_cmd_read_id;

Fields assignment:

cmd

Command code; the given field must be initialized by BOOT_READ_ID constant value.

echo

Package ID. Its value is selected arbitrarily before the command is sent. In the simplest case it is a counter value, increased by one while sending every new command. Bootloader does not analyze this field value. It simply copies it into response. Therefore, when response received, PC program can connect this response to previously sent command.

After this command is processed, Bootloader sends response with BOOT_READ_ID code.