Selecting a Microcontroller – Part 6: Migration

Dennis Cecic, P. Eng. (
Senior Member, IEEE Toronto Section

You’ve made an MCU choice and are proceeding on a development. What happens if you discover that you need more performance/memory from your MCU? In this final article of the series, we will provide an overview of how to move around the Microchip PIC® MCU product family. There are definitely large portions of the portfolio which are CPU, pinout and peripheral-compatible, easing the transition of your application firmware. We will then provide specific recommendations in migrating from our 3 hero MCUs (PIC16F19197PIC24FJ1024GA606PIC32MZ1024EFH064) into other devices.

“Painless” Migration

The following chart organizes 8, 16 and 32-bit PIC MCU devices by functionality and performance:

Fig. 1. PIC MCU Family Migration Paths

In general, the easiest code and pin migration will be found by moving within the same instruction set architecture (ISA) family bubble:

  • PIC18F devices run at 16 MIPs, and use an enhanced 8-bit CPU which is assembly-language compatible with PIC16F1 CPU but has support for hardware multiply operations and a second HIGH-priority interrupt vector
  • dsPIC33E use the same CPU as PIC24F devices and can run up to 70 MIPs. The CPU contains additional hardware for DSP operations.
  • For information on migrating between PIC32MX and PIC32MZ applications, see Appendix A, PIC32MZ Data Sheet

Migration Considerations – CPU

Many CPU differences should be taken care of by your compiler, as long as you write code in standard ANSI-C. Using standard C char, float and integral types (defined in “stdint.h“) will definitely help. Make sure to benchmark your main application execution time to verify that it still meets your project requirements. Hardware-specific built-in functions will need to be re-written.

Migration Considerations – Interrupts

As discussed in Part 4 – I/O Throughput, the interrupt controller in PIC24/PIC32 MCUs provides significant operational enhancements which will require updates to your PIC16 interrupt code, such as:

  • Dedicated interrupt vector (and handler routine) for each interrupt source
  • Programmable interrupt priority and sub priority
  • Shadow register set support

Migration Considerations – Clock

A primary consideration when migrating between MCUs is the instruction clock frequency (Fcyc) at a given oscillator frequency (Fosc). 

  • 8-bit PIC MCUs use Fcyc=Fosc/4
  • 16-bit PIC MCUs use Fcyc=Fosc/2
  • 32-bit PIC MCUs use Fcyc=Fosc/1

Not only does this effectively double or quadruple the instruction rate at the same input oscillator clock frequency, but also changes the base clock used by many peripherals that utilize the instruction clock as their basis. This frequency change needs to be accounted for when migrating to ensure that peripherals function as expected.

Migration Considerations – Peripherals

There’s a very good chance you’ll need to re-write your peripheral driver code when moving to another MCU family. Having said that, there are huge swaths of 16-bit and 32-bit PIC MCUs that share virtually identical peripheral hardware, minimizing the required changes.

Migration Considerations – Pinout

As mentioned, there is considerable pinout mobility within the ISA family bubbles in the chart above. Review the target MCU data sheet carefully to confirm pinout compatibility!

Moving from the hero MCUs – Some Destinations

Please ensure that you carefully review the target MCU data sheet to assess CPU, Interrupt, Pin and Peripheral compatibility with your current MCU. Here are some suggestions if migrating from our hero MCUs:


Same pin-out, same MCU family

  • PIC16F1527-I/PT (Supports Hardware Debugger Stopwatch feature, but maximum Fcyc = 5 MIPs, and no peripheral pin select feature (PPS))
  • PIC16F1947-I/PT (External Crystal Oscillator option is available, runs at 8 MIPs)

Smaller pin-count, same RAM (4kB), 8 MIPs, has PPS

Smallest pin-count, 8 MIPs, has PPS

Same pin-out, higher MIPs and program memory

  • Any 64-pin PIC18Fxxx MCU (i.e. PIC18F67J94-I/PT) – 16 MIPs, PPS


Smaller pin-count, low power, low cost, high integration

Similar pin-out (review the data sheet), same CPU core, higher CPU clock (Fcyc)

Similar pin-out (review the data sheet), same CPU core, DSP capability

In all these cases, the target peripheral set should be carefully reviewed to evaluate application suitability and effort for porting the code.


This MCU is almost at the pinnacle of the PIC MCU portfolio. Here are some directions:

Same pin-out, higher CPU clock speed (Fcyc), higher program memory

Higher pin count (more digital/analog I/O):

If you need low pin count, PIC32 device, consider PIC32MX family devices (based on MIPS M4K core)

There is no real “low power” variant for this family, suitable for long duration, battery-powered applications. Consider migrating to PIC24F MCUs.

Migration Guides

PIC32MX to PIC32MZ – See Appendix A, PIC32MZ Data Sheet

Microchip 8-bit to 16-bit Migration Page

Microchip PIC18F to PIC24F Migration Guide