Introduction to Device Family Packs (DFPs) in the MPLAB X IDE
Introduction to Device Family Packs
Watch this video for a comprehensive tutorial on Device Family Packs (DFPs) or scroll down to read all about DFPs.
Device Family Packs - A Little History
Until recently, Microchip’s MPLAB® X Integrated Development Environment (IDE) and MPLAB XC Compilers came only with built-in support for Microchip devices that were available at the time of their release. This meant that these tools consisted of one convenient package to download and install but it also meant that when you wanted to commence projects targeting newly released devices, you had to wait for a new MPLAB X IDE and a new version or part-support update of your compiler before you could proceed.
Microchip has updated its tools so that device support is now handled by Device Family Packs (DFPs). Beginning with the versions listed in the "Minimum Tool Versions Using Packs" table, DFPs will be used by the tools listed to provide information for the devices used in your projects. This page discusses the advantages that these packs offer.
Minimum Tool Versions Using Packs
Tool | Version |
---|---|
MPLAB X IDE | 5.40 |
MPLAB XC8 | 2.20 |
MPLAB XC16 | 1.35 |
MPLAB XC32 | 2.20 |
The Purpose of DFPs
DFPs are a way of packaging and distributing device-support files. They are essentially a structured directory of files that provide information related to each device family. Some of these files are compiler-related device-specific header files, configuration bit data, and libraries; other files relate to device information displayed by MPLAB X IDE and algorithms the IDE uses to program and debug the device. The files are organized in each pack so that the tools know where to find the information they need. A DFP has a version number, just like the compilers and MPLAB X IDE, so that they can be identified.
Before DFPs became available, device information was read from fixed, internal locations in the tool distribution. Now that DFPs are used, MPLAB X IDE and MPLAB XC Compilers have been modified so that they can read the required files on a device-by-device basis and from arbitrary locations that can be selected when building a project. This means that the tools and their support for devices are segregated and each can be updated independently. As new versions of DFPs are made available, they can be used without having to update your current tools.
New releases of DFPs may correct known issues in the resources used by MPLAB X IDE or compilers, however, they will never patch or improve the IDE or compiler applications themselves. This still takes place through the release of new versions of these products.
Using DFPs From Within MPLAB X IDE
During the installation of MPLAB X IDE, only those DFPs relating to device families you require need to be installed. To save disk space and speed up the installation process, you might choose to install no device support at all.
When you create a project in MPLAB X IDE, a DFP will be automatically selected if one is available. In the Project Properties dialog, you can see all the available packs and select the one you want to use.
The currently selected pack can be seen on the dashboard.
Once you build a project, the pack and version number that was used is displayed in the output view after the build transcript.
If a pack is not available when you open or create a project, you’ll be prompted to download a relevant pack for the project's device family.
DFPs that are individually downloaded in this way are stored separately to MPLAB X IDE under .mchp_packs in your user directory, where they can be used by all MPLAB X IDE installations.
MPLAB X IDE’s pack manager can be opened from the Tools > Packs menu. From here, you can browse for DFPs by device family. It lets you see which new and updated DFPs are available, which devices they support, and what changes they implement. Links allow you to install new packs so that they can be used by MPLAB X IDE and compilers.
Tool packs are also shown by this manager. These contain only firmware and are automatically downloaded by a DFP if they are needed, so you do not usually need to concern yourself with these.
When using MPLAB X IDE, you can create projects for new devices, even if your version of MPLAB X IDE was released before the device became available. To allow this to happen, MPLAB X IDE queries an online index file to fill out the device selection widget in MPLAB X IDE’s Project Properties dialog. So, provided your MPLAB X IDE has Internet access, it can find new devices released after your MPLAB X IDE was downloaded and can obtain the latest device support for those devices.
Using DFPs With a Standalone Compiler
The compilers are distributed with the relevant content from the latest DFPs so that they can be used stand-alone and without the need for any further downloads or installs. Alternate or subsequently released DFPs can also be used when you build. We recommend that you use MPLAB X IDE to install new packs. If required, you can manually download packs from the Microchip Packs Repository page and store them on your host machine in the .mchp_packs directory. They are ZIP files that can be unpacked by most archiver applications, although it is best to unpack and install these using the pack manager in MPLAB X IDE by choosing Install from local source and selecting the .atpack file you have downloaded.
The -mdfp command-line option lets you select an alternate DFP when you build, rather than use the one shipped with the compiler. Specify the path to the compiler directory (either XC8, XC16, or XC32) inside the pack, referenced by version number and device family. Here are some examples of the option for different devices (compiler tools) and host operating systems:
-mdfp=/Users/john/.mchp_packs/Microchip/PIC16F1xxxx_DFP/1.3.117/xc8
-mdfp=/Users/Jane/.mchp_packs/Microchip/SAMD09_DFP/2.2.110/xc32