Accelerate Prototyping and Code Updates with a Modern In-Circuit Debugger

By Kenton Williston

Contributed By DigiKey's North American Editors

Developers face pressure to expedite product delivery, even as embedded systems grow more complex. In-circuit debuggers (ICDs) play a crucial role here, helping to quickly identify and fix bugs. However, traditional debuggers are bulky, inflexible, and difficult to use, making them unsuitable for today’s development requirements.

Developers can instead select a modern solution that is compact, has expanded functionality, and features more developer-friendly toolsets. In particular, they should seek support for rapid development and product updates in the lab and in the field.

This article briefly describes the role and requirements of ICDs. It then introduces a solution from Microchip Technology as an example of what developers should look for in a modern ICD. Also included are compatible development tools, tips for getting started, and a quick guide to using an ICD in production environments.

Benefits and challenges of ICDs

An ICD is a tool that connects to a processor installed within the target hardware. This connection provides real-time access to the processor while the system operates, permitting tasks such as step-by-step execution and memory inspection. An in-circuit programmer (ICP) builds on these capabilities by enabling code and data to be written into the processor memory. Together, these features are critical to the embedded development process.

However, traditional debuggers require specialized skills and development environments that can restrict their utility. These debuggers might also have limitations when troubleshooting production hardware, and they often require JTAG connections that are impractical to implement on production hardware due to cost and space constraints. Plus, the specialized software and hardware needed for debugging could be cumbersome to bring into field environments.

The PG164150 MPLAB PICkit 5 ICD/ICP from Microchip Technology overcomes these constraints. Among other features, it can be used through a smartphone application with Bluetooth Low Energy (BLE) connectivity. This enables technicians to deploy code images in the field, considerably expanding the possibilities for bug fixes and software updates.

Key features of the MPLAB PICkit 5

The MPLAB PICkit 5 is a versatile device that supports nearly all Microchip Technology microcontroller units (MCUs) and digital signal controllers (DSCs), including PIC, dsPIC, AVR, and SAM (Arm® Cortex®-based) devices. As shown in Figure 1, it incorporates a microSDHC card slot that enables the tool to store multiple device memory images.

Image of overview of the Microchip MPLAB PICkit 5Figure 1: Shown is an overview of the MPLAB PICkit 5 highlighting its key features. (Image source: Microchip Technology)

The MPLAB PICkit 5 connects to the host through a USB Type-C cable and can be powered either through this cable or by the target. The debugger also includes BLE connectivity, which allows users to access the tool from a smartphone.

The debugger features an 8-pin programming connector on the target side that supports various interfaces. These include 4-wire JTAG, Serial Wire Debug (SWD), Ethernet, backward-compatible 2-wire JTAG, and in-circuit serial programming (ICSP). Microchip Technology offers the AC102015 adapter board (Figure 2) that supports all of these interfaces.

Image of Microchip Technology AC102015 adapter boardFigure 2: The AC102015 adapter board accommodates a wide range of interfaces. (Image source: Microchip Technology)

The debugger supports target supply voltages from 1.2 V to 5.0 V for low-voltage program mode entry, and from 1.8 V to 5.0 V for high-voltage program mode entry. It can also directly supply the target device with 150 milliamperes (mA).

Additional functionalities include a Virtual Comm Port (VCOM), multiple hardware and software breakpoints, a stopwatch for timing operations, and the ability to debug source code files directly. The debugger is powered by a 300 megahertz (MHz) ATSAME70N2 MCU running a real-time operating system (RTOS), ensuring no firmware downloading delays when switching between devices. This onboard intelligence also enables the debugger to support new target devices and features.

Key improvements compared to MPLAB PICkit 4 and MPLAB PICkit 3

The MPLAB PICkit series has continuously evolved, introducing flexibility, speed, and device compatibility improvements with each iteration. Table 1 summarizes the critical upgrades in the MPLAB PICkit 5 compared to its predecessors.

Feature MPLAB PICkit 3 MPLAB PICkit 4 MPLAB PICkit 5
Supported devices PIC PIC, dsPIC All Microchip architectures
Wired connectivity USB Mini Micro USB USB Type-C
Wireless connectivity No No Bluetooth Low Energy (BLE)
Remote programming No No Programmer-To-Go (PTG)
In-field programming No Limited Multiple program images
Form factor Compact Limited Mulitple program images
Speed Moderate Fast Faster

Table 1: The MPLAB PICkit 5 offers many advantages over its predecessors. (Table source: Kenton Williston)

Development environments supported by the MPLAB PICkit 5

The MPLAB PICkit 5 supports development environments, including:

The smartphone app (Figure 3) is particularly noteworthy; it enables users to remotely program the target hardware using a straightforward process:

  • Code is developed using MPLAB X and compiled into a .ptg hex file that encapsulates code, data, and configuration information.
  • The hex file is downloaded to a microSDHC card inserted in the MPLAB PICkit 5.
  • The microSDHC card can accommodate multiple hex files, giving users flexibility in programming target devices.
  • The MPLAB PICkit 5 is plugged into the target hardware.
  • Using the smartphone app, the user selects a saved program image on the memory card to program the target.

Image of Microchip Technology MPLAB PTG smartphone app (click to enlarge)Figure 3: The MPLAB PTG smartphone app offers a straightforward interface. (Image source: Microchip Technology)

The MPLAB PTG is particularly useful in remote or mobile settings where additional equipment is impractical. It can program devices directly in the field without a computer, effectively transforming the MPLAB PICkit 5 into a standalone programming tool.

For developers, this facilitates quick on-site firmware updates, accelerating development cycles and reducing time to market. Technicians can then use MPLAB PTG to update other field devices, enabling a rapid rollout of product upgrades. The tool is also valuable for emergency scenarios where quick reprogramming is necessary to restore device functionality.

Getting started with the MPLAB PICkit 5

Using the MPLAB PICkit 5 with the MPLAB X IDE is a process that should be familiar to any embedded developer. The fundamental steps are as follows:

  • Installation: The latest version of the MPLAB X IDE must be installed. The MPLAB PICkit 5 is usually supported without additional drivers, but developers should check the Microchip Technology website for the most current information.
  • Project setup: PICkit 5 can be selected as the hardware tool for programming and debugging when creating a new project. This selection is made within the project properties under the “Hardware Tool” category.
  • Programming: Once a project has been configured and the code prepared, the MCU may be programmed by activating the “Make and Program Device” button.

The MPLAB IPE offers a more straightforward process for technicians in a production environment. The key steps to using this tool are as follows:

  • Configuration: The MPLAB PICkit 5 should be selected from the available tools. The target device (MCU model) and the hex file intended for programming must then be selected.
  • Programming: With the device and hex file chosen, the MCU may be programmed by pressing the “Program” button. If necessary, the MPLAB IPE will erase the target device, program it, and verify the programming.

In either environment, users are likely to encounter technical difficulties. Often, these problems are caused by simple issues that can be addressed as follows:

  • Ensure proper connections: The developer should check the connections to the host and the target device. If using an ICSP interface, attention should be paid to the orientation of the connector.
  • Check power settings: The power settings should be verified. Some devices may be powered directly by the MPLAB PICkit 5, while others might require external power.
  • Update firmware: Firmware updates for the MPLAB PICkit 5 are periodically released by Microchip Technology. Developers should ensure that the latest version is installed.

Development kits compatible with the MPLAB PICkit 5

The MPLAB PICkit 5 is compatible with various development kits designed for learning, prototyping, and developing applications. For example, Curiosity Low Pin Count (LPC) Development Boards like the DM164137, which support 8, 14, or 20 pins, are designed for experimentation with PIC MCUs. These boards often include an integrated programmer and debugger, but an external tool like the MPLAB PICkit 5 can offer additional features. Developers should check whether the onboard programmer can be disconnected via a jumper option.

Xpress Evaluation Boards like the DM164140 for the PIC16F18855 are another example. These boards are designed for rapid prototyping with specific PIC MCUs. They come with a built-in programmer and debugger, but developers may use the MPLAB PICkit 5 for consistency across projects or for features specific to this debugger.

Microchip Technology also offers starter kits, like the DM320105 PIC32MX XLP evaluation board, that provide the hardware and software necessary to start development quickly. The MPLAB PICkit 5 would be useful for programming and debugging the MCUs included in these kits, offering a seamless experience.

Conclusion

Modern ICDs can help developers accelerate development cycles and roll out product updates in the field. The MPLAB PICkit 5 supports a broader range of target devices, connectivity options, and software tools than previous debuggers, giving it a high degree of flexibility and utility. Its smartphone app is particularly noteworthy, as it permits using the MPLAB PICkit 5 in settings that are difficult to access with traditional debuggers.

DigiKey logo

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of DigiKey or official policies of DigiKey.

About this author

Image of Kenton Williston

Kenton Williston

Kenton Williston received his B.S. in Electrical Engineering in 2000 and started his career as processor benchmark analyst. Since then he worked as an editor with the EE Times group and helped launch and lead multiple publications and conferences serving the electronics industry.

About this publisher

DigiKey's North American Editors