Getting Started: Running the “Host – Bootloaders – Thumbdrive Bootloader” demo

Required Hardware: 1

Configuration 1: Explorer 16. 1

Configuring the Hardware: 1

Configuration 1: Explorer 16. 1

Firmware. 3

Creating a hex file to bootload. 3

Loading the hex file. 4

Trademarks: 5

## Required Hardware:

To run this project, you will need one of the following sets of hardware:

### Configuration 1: Explorer 16

PIC24FJ256GB110 Plug-In-Module (PIM) (MA240014)

Explorer 16 (DM240001)

USB PICtail™ Plus Daughter Card (AC164131)

## Configuring the Hardware:

This section describes how to set up the various configurations of hardware to run this demo.

Configuration 1: PIC24FJ256GB110 PIM + Explorer 16

### Configuration 1: Explorer 16

1) Before attaching the PIC24FJ256GB110 PIM to the Explorer 16 board, insure that the processor selector switch (S2) is in the “PIM” position as seen in the image below.

2) Short the J7 jumper to the “PIC24” setting

3) Before connecting the PIC24FJ256GB110 PIM to the Explorer 16 board, remove all attached cables from both boards. Connect the PIC24FJ256GB110 PIM to the Explorer 16 board. Be careful when connecting the boards to insure that no pins are bent or damaged during the process. Also insure that the PIM is not shifted in any direction and that all of the headers are properly aligned.

3a) If using the PIC24FJ64GB004 PIM, please insure that the programming port switch is switched in the PGX1 direction.

4) On the USB PICTail Plus board, short jumpers JP2 and JP3. Remove all other shorts on the board.

5) Connect the USB PICTail Plus board to either of the female PICTail Plus connectors or on the card edge connector (J9) at the edge of the Explorer 16 board.

Firmware:

The source code for this demo is available in the “<Install Directory>\USB Host - Bootloaders\Mass Storage Bootloader” directory. In this directory you will find all of the user level source and header files as well as project and workspace files for each of the hardware platforms. Find the project (*.mcp) or workspace (*.mcw) file that corresponds to the hardware platform you wish to test. Compile and program the demo code into the hardware platform. For more help on how to compile and program projects, please refer to the MPLAB® help available through the help menu of MPLAB (Help->Topics…->MPLAB IDE).

Creating a hex file to bootload

Any application in the MCHPFSUSB release can be used to create a hex file the can be loaded with this bootloader.

In order to create a new hex file to bootload, follow these steps:

MPLAB 8:

1) first open up the target project.

2) Insure that the correct processor is selected in the “Configure->Select Device” option of MPLAB 8

3) If there is a linker script already attached to the project, remove it from the project by right clicking on it and selecting remove.

4) Copy the appropriate linker file to the demo project folder. The linker files for the thumbdrive bootloader can be found in the “<install directory>\USB Host - Bootloaders\Mass Storage Bootloader\Application Files\Linker Files” folder.

5) Add this file to the project by right clicking on the “linker scripts” folder in the project window, select “Add Files…”. Select the correct file.

6) Compile the project.

7) Rename the resulting .hex file to “image.hex”. It is important that the name be exact. The bootloader is looking for that file specifically by name.

MPLAB X:

1) first open up the target project.

2) Select the configuration that corresponds to your demo board.

3) Copy the appropriate linker file to the demo project folder. The linker files for the thumbdrive bootloader can be found in the “<install directory>\USB Host - Bootloaders\Mass Storage Bootloader\Application Files\Linker Files” folder.

4) Add this file to the project by right clicking on the “linker scripts” folder in the project window, select “Add Existing Item…”. Select the correct file that corresponds to the processor that is being used on the demo board.

5) Compile the project.

6) Rename the resulting .hex file to “image.hex”. It is important that the name be exact. The bootloader is looking for that file specifically by name.

Loading the hex file

Once the image.hex file is created through the process listed above, copy this file onto a thumbdrive. Insert the thumbdrive into the USB PICtail Plus A connector. On the Explorer 16, Press and hold the S3 button while resetting the board by pressing the MCLR button or applying power to the board.

The D5 LED should illuminate if this is done correctly. The D5 LED should turn itself off once the bootload process is complete. At this point of time the application should be running. If you wish to abort a bootload sequence you can press the S6 switch or power cycle the board.

## Trademarks:

The Microchip name and logo, the Microchip logo, MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

PICDEM is a trademark of Microchip Technology Incorporated in the U.S.A. and other countries.

Microsoft, Windows, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.