Migrating from PIC18 to PIC24F Microcontrollers Made Easy
Our extensive product portfolio of PIC® Microcontrollers (MCUs) to help you select the device that best suits the needs of your application.
Microchip offers an extensive product portfolio of PIC® Microcontrollers (MCUs) to help you select the device that best suits the needs of your application. As time progresses, you may be faced with the need to expand or even downsize an application to add, optimize or otherwise modify the design.
Microchip’s PIC18 MCUs are among the most popular available today, as they offer versatility and easy-to-use Core Independent Peripherals (CIPs) with advanced interconnection capabilities. More often, your design requirements may increase, requiring more performance, more flash, more RAM or faster peripherals than are available on the PIC18 MCU you used in your original design.
To offer upward migration and continuity of the PIC MCU product line, PIC24F MCUs have been created as a powerful extension to the PIC18 MCU portfolio. The PIC24F architecture provides an even greater range of options for computational power and rich peripheral sets. At the same time, the architecture is tailored to keep as much of the existing PIC® MCU feature set and nomenclature as possible, making it easy to scale up or scale down your MCU if you are running out of or have an excess of resources in your application.
Let’s examine some key considerations when migrating between Microchip’s PIC18 and PIC24F MCU portfolios.
Executing Tasks
Your design may need to optimize how quickly it responds to external or internal events, or perhaps execute more elaborate math operations so the device can perform a given task and then reenter a low-power mode. Both PIC18 and PIC24F architectures feature a wide selection of core independent peripherals designed to minimize task execution time.
However, there are times when a task must be handled in software. In this case, you may want to consider migrating from a PIC18 to a PIC24F MCU. The PIC24F architecture features a software stack alternative that simplifies complex software operation using multiple nested subroutines and offers faster instruction cycles and a clock for executing a task quickly.
Memory
In addition to executing embedded firmware faster, more memory may be needed in some applications to accommodate more elaborate software applications. PIC18 MCUs provide up to 128KB of flash program memory with up to 4KB of data SRAM storage. PIC24F MCUs can accommodate larger memory of up to 1MB of program flash and up to 32KB of SRAM data memory.
Low Power
Low power is a key concern in many embedded applications and both architectures feature various capabilities to minimize power consumption. In conjunction with industry-leading low-current consumption, doze, idle and sleep modes of operation provide flexible CPU and peripheral clocking options with the ability of many peripherals to operate in these lower-power states. Additionally, PIC24F MCUs further provide a deep-sleep option that further reduces current consumption by removing power to RAM memory cells.
Pin Considerations
PIC18 MCUs are typically designed to be as small as possible while heavily integrating capabilities with packages mostly in the low pin counts. However, there are instances where the application requirements demand additional pins. In these instances, you may want to explore PIC24F devices that offer packages starting at 14 pins up to 121 pins. Both PIC18 and PIC24F architectures make it easier to migrate across platforms by providing flexible pin configuration of digital signals through the peripheral pin select functionality. This allows most of the digital peripheral signals to be routed to a variety of user-selectable pins to simplify board layout complexity and help minimize application redesign. Pins can even be assigned on the fly with mechanisms in place to temporarily or permanently lock pin configuration at run time to avoid pin signal uncertainty. PIC24F devices also feature the flexibility to choose from a few program/debug pin connection options while also adding the ability to simplify production programming diagnostics by providing a Joint Test Action Group (JTAG) boundary scan option. Additional pin capabilities on many PIC18 and PIC24F architectures include the ability to apply pin signal slew-rate control, an open-drain control option and the ability to apply on-chip weak pull-ups with PIC24F devices also featuring weak pull-down options on select devices.
To further assist with the migration and key hardware consideration to be kept in mind while migrating from a PIC18 to PIC24F MCU, the following Microchip design guide will help: PIC18F to PIC24F Migration and Performance Enhancement Guide. This document will help ease migration concerns when moving from one family to the other. Most changes, such as data bit width, instruction word size, instruction clocking scheme, and stack and core registers, primarily only affect assembly-based programs and get abstracted in case C-based programs. Other hardware features have been added to enhance processing performance.
Peripherals
Recent PIC18 and PIC24F MCUs focus on high peripheral integration – especially those that can operate independent of the core, minimizing the amount of software needed for the application. Both architectures feature similar peripherals, making it easier to migrate from one family to another.
Tools and Resources
The following additional Microchip tools and resources may help in your design efforts.
To learn more about peripheral mapping between the two families, refer to Mapping Peripheral Capabilities When Migrating From 8-bit to 16-bit PICMCUs (DS30010196).
• Preserving Your Code Investment - MPLAB® Code Configurator and Migration Considerations
MPLAB Code Configurator (MCC) is a free graphical programming environment used to generate seamless, easy-to-understand C code that can be inserted into a project. Offering an intuitive interface, MCC enables and configures a rich set of peripherals and functions specific to an application. MCC is incorporated into MPLAB X IDE to provide a powerful and easy-to-use development platform. Many MCC generated peripheral drivers share common driver interfaces for both PIC18F and PIC24F, even if the underlying hardware peripherals are different. Common programming interfaces help ease the migration of application code. Even if the current PIC18F firmware did not use the code generated from MCC, it is still useful to utilize MCC in generating PIC24F code as it helps reduce the hardware learning curve. Common middleware libraries, such as USB, File System, Bootloader, CryptoAuth library and more, are also available as part of MCC supporting both the device families.
To learn about migrating your code from PIC18 to PIC24F using MPLAB Code Configurator (MCC), refer to the PIC18F to PIC24F Software Migration Guide (DS00003146).
Staying in the Same Ecosystem - A Common Development Ecosystem Eases Migration
You don’t have to start from scratch when your design requirements shift. Our MPLAB® development ecosystem enables you to painlessly move between PIC18 to PIC24F MCUs without major setbacks in your development timeline. PIC18 and PIC24F MCUs share a common development ecosystem comprising:
►MPLAB X Integrated Development Environment (IDE): Expandable, highly configurable software program that incorporates powerful tools to help you discover, configure, develop, debug and qualify embedded designs
►Curiosity Development Boards: Cost-effective, fully integrated development platform
►Use your existing MPLAB PICkit™ debugger or ICD debugger across both architectures
Additional Resources
PIC18 Microcontrollers: learn more about PIC18 families
PIC24F Microcontrollers: learn more about PIC24F families
8-bit PIC® Microcontroller Peripheral Integration: all the available peripherals across PIC18 family range
16-bit PIC® Microcontroller Peripheral Integration: all the available peripherals across PIC24 family range.
These capabilities on Microchip’s PIC18 and PIC24F MCUs – along with a focus on easy-to-use software and hardware development tools – provide a flexible and streamlined solution to help optimize the design process. Learn more about migratiation.