Bootloading: PIC18F45K22 | PIC18F25K22

Boot loading …

PIC18F45K22 Family

As mentioned in other articles, boot loading is a method whereby a PIC self programs. The PIC is pre-programmed with the boot loading firmware and then a PC based piece of software is used to connect to the PIC target PCB and the hex file is uploaded onto the device.

Obtaining Boot loading Firmware

PIC devices have allot in common across the family ranges and PIN compatibility is one of them. However, each device has some features unique to that particular device and owing to this boot code may need to be customized per device.

For some time I have been working with the PIC18F45K22 device that is part of a family of devices which includes both 28 and 40 PIN devices. At times there is no need for a 40 PIN device, or in other words a 28 PIN device or the PIC18F25K22 would suffice.

Granted when moving to a smaller device you loose some pins and the second com port, but for the sake of saving space on the PCB, cost reduction of the production variant and so on, certain sacrifices are justifiable.

Why the PIC18F45K22 family ?

Microchip has an array of devices to choose from; so much so that sifting through the datasheets can leave you scratching your head more than point a finger at the device you want. I chose the device for a number of reasons

  1. Features: dual comports, decent analogues high running speed
  2. Cost effective
    1. Short term cost effectiveness i.e. few limitations to writing code and getting the most out of the device
    2. Since the device is feature rich, any new features are not hindered by limitations of the device
  3. The boot loader allows for quick updates on code and bug fixes

Family Devices

Recently, I tried to reuse code written for one device in the same family on one of its smaller siblings and viola, it worked. My boot loader can now work for PIC18F25K22s or PIC18F45K22s.

System enhancements (Keeping Customer happy)

Scope creep is just one of those things in the contract business. The project always starts out with base features commonly known as phase 1 with the wish list being Phase 2^N+1 and then to keep the customer happy ? Well there are those phone calls and emails where the customer starts asking questions about the delivery progress and you get the feeling that the frill features they have been harping on, their nice to haves are must haves. You could deliver them on demand or you can deliver them in increments quickly and efficiently using the boot loading technique.

The Main Complication

The main complication with using a boot loader is that you have to have access to a PICKIT 3 or at least a PIC Microchip compatible device at least once to load your code onto your PIC. Hmm, …

But never fear, when you purchase a ProtoDev 40, the PIC comes pre – programmed with boot loading software. See here: ProtoDev 40 Getting Started.


A useful link : AN851 – A FLASH Bootloader for PIC16 and PIC18 Microchip