Microchip logo
  • All
  • Products
  • Documents
  • Applications Notes

PIC32MK Microcontrollers for Motor Control Applications

PIC32MK microcontrollers (MCUs) combine 32-bit, 120 MHz performance with up to 1 MB of dual-panel live update Flash memory with Error Code Correction (ECC) for creating high-performance applications. They offer a range of communications and other peripherals combined with a rich feature set of high-performance analog motor control functions that make them an excellent option for developing motor control, industrial control, Industrial Internet of Things (IIoT) and automotive applications.

Key Features

Key FeaturesPIC32MK GPK/MCM FamilyPIC32MK GPG/MCJ Family
General Purpose
CoreMIPS32 microAptiv™MIPS32 microAptiv
CPU Frequency120 MHz120 MHz
Double Precision Floating Point Unit (FPU) and DSP Extension Support
Flash with ECCUp to 1 MB of Dual-Panel Live UpdateUp to 512 KB
SRAMUp to 256 KB64 KB
Pin Count64 and 10048 and 64
Shadow Register Set for Reduced Interrupt Latency77
CAN FD ModulesUp to 41
Full Speed USBUp to 2-
UART ModulesUp to 6Up to 2
SPI/I2S Modules62
AEC-Q100 Qualified
Motor Control
Analog-to-Digital Converters (ADCs)7 × 12-bit
3.75 Msps (25.45 Msps combined)
42 channels 
7 × 12-bit
3.75-Msps (25.45 Msps Combined)
30 channels
Digital-to-Analog Converters (DACs)Up to 3 × 12-bitUp to 2 × 12-bit
Pulse-Width Modulation (PWM) Pairs129
PWM Resolution8.16 ns8.16 ns
High Bandwidth Op Amps44
Op Amps Slew Rate40 V/µs40 V/µs

PIC32MK GPD/GPE/MCF Family (Legacy Products): These devices have CAN instead of CAN FD, lower-bandwidth op amps, no ECC on the Flash and no I2C interface.

PIC32MK MCM Family Block Diagram

Click to Enlarge

Sensorless Single-Motor Drive with PIC32MK MCUs

PIC32MK MCUs make it easy and cost effective to implement single-motor drive applications. Their internal op amps reduce the need for external devices. Use their multiple Analog-to-Digital (ADC) conversion cores to dedicate an ADC to each motor phase that you want to measure rather than sharing the conversion of two or more phases on a single ADC. This reduces code complexity and increases resolution since you can capture more samples per phase without having to calculate complex timing between phases on a single ADC. Internal high-speed comparators with PWM fault triggering can also be used as over-current protection across the two measured phases.

Sensorless Single-Motor Drive with PIC32MK MCUs
Sensorless Single-Motor Drive with PIC32MK MCUs

Click to Enlarge

Sensorless Dual-Motor Drive with PIC32MK MCUs

Many motor control applications require multiple motors. With their hefty selection of integrated peripherals, the PIC32MK series of MCUs is up to the challenge of driving dual, sensorless motor applications. Although it is similar to the block diagram for single-motor, dual-shunt sensorless control, this block diagram shows that the peripheral requirements are doubled for two motors. Since the PIC32MK MCUs offer seven ADC conversion cores, you don’t have to worry about sharing converters between phases or motors. This significantly reduces the software timing overhead. All four op amps and four out of five comparators are used for this application.

Sensorless Dual-Motor Drive with PIC32MK MCUs
Sensorless Dual-Motor Drive with PIC32MK MCUs

Click to Enlarge

Sensored Motor Control with PIC32MK MCUs

For applications requiring more than just speed and torque control, but also requiring absolute positioning (rotor angle) measurements, PIC32MK MCUs are an excellent option. The six Quadrature Encoder Interfaces (QEIs) are ideal for multi-axis CNC machines and robotics designs. Stepper motors, which have high torque holding and are easy to control accurately, are common in these applications. The PWM modules can be independently timed for multi-axis control. When coupled with a smart stepper driver, a PIC32MK MCU can drive up to six stepper motors while providing high-precision sensored feedback.

Simulation and Modeling Tools

MPLAB® Device Blocks for Simulink® provide a set of user interfaces and Simulink peripheral blocks for PIC32MK and SAM MCUs. Create stand-alone applications from a Simulink discrete time model and, with one click, generate, compile and load on the code for your application onto your target device. The package also provides many examples in the form of demo models, including a complete BLDC motor control application, to further simplify your development. The latest version includes support for single-shunt motor control algorithms and includes Simulink models for several additional examples.

PIC32MK devices are also supported in the open-source Scilab simulation package, a two-part modeling environment that includes the Scilab main and Xcos system modeler.

Scilab Key Features

  • Mathematics and simulation
  • Data visualization
  • Optimization
  • Statistics
  • Control system design and analysis
  • Signal processing
  • Algorithm development
  • Application deployment
Learn More About Scilab

Xcos Key Features

  • Standard palettes and blocks
  • Model building and edition
  • Model customization and Modelica blocks creation
  • Simulation
Learn More About Xcos

Development Software and Hardware

MPLAB® Harmony, a flexible, abstracted, fully integrated firmware development platform for PIC32 microcontrollers, provides support for peripherals, application demos and motor control applications using the PIC32MK family of MCUs. It combines the key elements of modular and object-oriented design and the flexibility to use a Real-Time Operating System (RTOS) or work without one, and provides software modules that are easy to use, configurable for your specific needs, and that work together in complete harmony. It also includes a set of peripheral libraries, drivers and system services that are easily accessible for your application development. The code development format allows for maximum re-use and reduces your time to market.

We also offer the following motor control development boards to simplify your development with PIC32MK devices. You will also need to purchase the PIC32MK MCM Motor Control Plug-In Module to add a PIC32MK device to your design. Demo examples for sensored and sensorless Field Oriented Control (FOC) of a permanent magnet synchronous motor are available within MPLAB Harmony v3.

dsPICDEM™ MCLV-2 Low-Voltage Motor Control Development Board

dsPICDEM MCLV-2 Low-Voltage Motor Control Development Board
Buy Now

dsPICDEM MCHV-2 High-Voltage Motor Control Development Board

dsPICDEM MCHV-2 High-Voltage Motor Control Development Board
Buy Now

dsPICDEM MCHV-3 High-Voltage Motor Control Development Board

dsPICDEM MCHV-3 High-Voltage Motor Control Development Board
Buy Now

PIC32MK MCM Motor Control Plug-In Module

PIC32MK MCM Motor Control Plug-In Module
Buy Now
Application Notes
Data Sheet
Product Document
Technical Brief