Microchip AN247 CAN Bootloader Application Note

Microchip's Enhanced FLASH Microcontroller devices have the capability of self-programming the program memory, providing the user with the ability to perform bootloading operations. This application note demonstrates a simple bootloader implementation for the PIC18F families of microcontrollers with a CAN module. It provides a low-level framework that can be used with higher-level network protocols to develop more complex and custom-tailored systems.


Microchip AN247 CAN Bootloader Application Note - cover page
Brand
MICROCHIP
Category
Other Electronics
Document type
Application Note
Language
English
Pages
32
File format
PDF
File size
695 KB
Published
02 May, 2012
Updated
28 September, 2023
MD5 checksum
055BF1D403ABCDA6F2EA41D52E4456D0

About this manual

The AN247 note introduces a CAN bootloader that enables in‑field programming of PIC18F devices with a dedicated boot block. It describes how the bootloader can be triggered by hardware events (e.g., a button press after reset) or by a special CAN message, and discusses the trade‑offs of single‑node versus group programming over a CAN bus.

Key sections detail the memory organization (512‑byte boot block, program, EEPROM and configuration regions), the command set (PUT/GET, control bits, special commands), compile‑time options (PMode vs. PG Mode, self‑verification) and practical considerations such as write latency, vector remapping and debugging. The note provides example code snippets and guidance for both assembly and C implementations.

What's inside

  • Introduction
  • Considerations for Field Programming Over the CAN Bus
  • Boot Mode Entry
  • Bootloader Firmware – Basic Operation Overview
  • Memory Organization
  • Remapped Memory and Vectors
  • Control Registers and Control Bits
  • Command Set and Special Commands
  • Reading/Writing/Erasing Program Memory
  • Compile‑Time Options and Modes of Operation

Specifications

Boot block size512 bytes
Program memory write latency≈2 ms per 8‑byte block
EEPROM write latency≈4 ms per byte
Maximum data per CAN frame8 bytes
Control register count8 registers (D0–D7)

Frequently asked questions

How many bytes can be written to memory in a single CAN frame?

A single CAN frame can carry up to 8 bytes of programming data.

What events can cause the device to enter boot mode?

Boot mode can be entered by a hardware event such as pressing a button after reset, or by a network event like receiving a special CAN identifier.

Download PDF (695 KB)

More MICROCHIP Manuals


View all MICROCHIP manuals →