Using the Bootloader

The board is delivered pre-programmed with the Microchip Bootloader, a simple serial port based bootloader as described by the application note AN1310.

The full download for the bootloader can be found on the Microchip website here. There are lots of files in there, and if you only want to use the bootloader you only need the user guide, the PC application and (possibly) the hex file for the LPLC. You can get those here: PIC18FBootloader

To use them, download the zip file and then extract its contents into a directory, anywhere. I created a directory called C:\LPLC, and downloaded them there.

The userguide is the pdf file 01310a.pdf.

I found that userguide a bit confusing, so I will explain the use of the bootloader in – I hope! – clearer terms.

Start by powering up the LPLC, connecting the USB serial cable to the PC and running the bootloader application, an1310ui.exe. You will see a dialog like this appear:

 

boot-buttons

I’ve highlighted the three buttons of interest. When you first launch the program, you must click on the “Connect” button to connect the PC program to the LPLC board. We will come back to the other two buttons in a minute, because I am getting ahead of myself.

The very first time that you start the program you must configure the settings: The comm port used by your serial cable, and the baud rate to use to connect to the board. The settings dialog is selected by clicking on the Program Icon followed by Settings.

boot-settings

Choose the COM port number that matches your cable, and select the other options as above.

Once the settings have been updated you can close the dialog and select the File menu option of open a project .hex file:

boot-file-open

Once you have opened your projects .hex file, you can proceed to connect the program to the LPLC board by clicking on the red square icon.

Now, select the ‘Write Device’ option from the Program menu:

boot-program

Once the download has completed, you can click on the ‘Start User Application’ icon to, well, start the application.

Once the board has an application loaded, that application will start immediately on power-up. This will of course be a problem if you want to erase the application. To do that, you click on the “Force Entry” icon on the main menu and then power up the board. The “Force Entry” option puts the serial port signals into a special state (inverted) which the bootloader recognises as a request to enter bootloader mode, from which you can then load a new application.

 

Submit a Comment

Your email address will not be published. Required fields are marked *