Microchip Offers High-Performance DSP Library for PIC32

Submitted by BDTI on Wed, 04/22/2009 - 20:00

This month Microchip announced a “high-performance” software library of common DSP functions for its 32-bit microcontroller family, the PIC32. This library replaces Microchip’s earlier DSP library for the PIC32, which was quietly released last October. The library includes 16- and 32-bit vector math routines, 16-bit filters, and 16- and 32-bit FFTs.  Library components are implemented as C-callable assembly and are free of charge; support for the new functions has been added to the MPLAB C compiler for the chip.  

The main difference between the older and newer libraries is the FFT. According to Microchip, an 80 MHz PIC32 chip can execute a 256-point, 16-bit radix-2 FFT in 283 microseconds, which Microchip says is approximately 22% faster than the version in its previous PIC32 DSP Library. The improvement is due to additional assembly-level optimizations.

As BDTI discussed in an earlier article, the PIC32 family is based on the MIPS 4K core; it is the first Microchip MCU to use this core (earlier Microchip MCUs are based on Microchip-proprietary cores).  PIC32 chips execute at up to 80 MHz and cost about $3.00-5.00 in 10K quantities.  (BDTI has also published a white paper on the DSP capabilities of the MIPS 4K core and how it compares to the ARM Cortex-M3.)

The announcement follows close on the heels of ST Microelectronics’ announcement late last year of a DSP library for its STM32 microcontroller, which is based on the Cortex-M3 core. The STM32 operates at a similar top clock speed of up to 72 MHz. As shown below, however, the two libraries encompass different functions. For example, Microchip offers a range of 32-bit algorithms, such as a 32-bit FFT—ST doesn’t.  And ST offers a PID controller, which is a somewhat higher-level component than the building-block functions that comprise the bulk of both libraries. ST includes a Speex speech codec in its library; Microchip also offers Speex for the PIC32, but it's part of a separate audio library that includes ADPCM and WAV software components.

STM32 DSP Library Functions

PIC32 DSP Library Functions

Complex radix-4 16-bit FFT optimized for 64, 256, or 1024 points

16/32-bit complex radix-2 FFT

16-bit block FIR filter

16-bit block FIR filter


Prepare coefficients for 16-bit block FIR

16-bit auto-regressive moving-average IIR (ARMA) filter

16-bit single-sample IIR filter

16-bit biquad IIR filter

Prepare coefficients for 16-bit IIR


16-bit single-sample LMS filter

Speex speech codec

(available in separate audio library)

PID controller in C, error computed outside the routine


PID controller in C, error computed inside the routine


PID controller in ASM, error computed outside the routine


PID controller in C, error computed outside the routine



16/32-bit vector absolute value


16/32-bit vector add


16/32-bit add a constant to all elements of a vector.


16/32-bit vector dot product


16/32-bit vector multiply (multiply corresponding vector elements)


16/32-bit vector multiply by a constant


16/32-bit vector subtract


16/32-bit vector sum of squares

Table 1: DSP Software Components for PIC32 and STM32

Both ST and Microchip stipulate in their license agreements that the library functions can only be used on their respective chips.

Microchip is well-known for its popular 8-bit MCUs but is relatively new to the growing 32-bit microcontroller space. Having chosen to go with the MIPS core, the company is now competing with ARM-based chips and the juggernaut of the ARM ecosystem. Offering optimized DSP libraries for the PIC32 is a good strategy since even relatively low-cost, low-performance CPUs are often called upon to perform signal processing functions.  And as DSP has become ubiquitous in embedded applications, off-the-shelf DSP software components are becoming de rigueur for even low-end embedded processors.

Add new comment

Log in or register to post comments