The normal usage models of some of the more complex peripherals, (i.e., USB or network interfaces) require interpreting complex protocols or may require substantial additional processing to produce useable results, such as drawing graphical images on an LCD screen with an LCD controller peripheral. Therefore, while a device driver may be completely sufficient for a simple peripheral like a UART, some peripherals require what is frequently called "middleware" (aptly named because it sits between your application and the hardware abstraction_layer or "driver"_layer). MPLAB® Harmony provides several middleware library "stacks" to manage these more complex peripherals and provide the functionality you need and expect.
MPLAB® Harmony middleware "stacks" are usually built upon device drivers and system services so that they can be supported on any Microchip microcontroller for which the required driver or service is supported. However, special purpose implementations may be available that integrate the driver, certain services, and various modules within the "stack" for efficiency.
Click on the links below to get more details on each Middleware Library
Communication over the Internet is accomplished by implementing the IP protocol. Functions like web pages, email and FTP are advanced services that are part of a full IP stack implementation. Microchip offers a free full TCP/IP software stack optimized for the PIC32 family of MCUs and it operates seamlessly with Microchip's standalone Ethernet controllers (ENC28J60/ENC624J600) and Wi-Fi modules (MRF24WG0M).
MPLAB® Harmony TCP/IP compliant software is also available from third-party companies.
The MPLAB® Harmony TCP/IP Stack provides a foundation for embedded network applications by handling most of the interaction required between the physical network port and your application. It includes modules for several commonly used application layers, including HTTP for serving web pages, SMTP for sending emails, SNMP for providing status and control, Telnet, TFTP, Serial-to-Ethernet and much more. In addition, the stack includes lightweight and high-performance implementations of the TCP and UDP transport layers, as well as other supporting modules such as IP, ICMP, DHCP, ARP, and DNS.
- IPv6 support (gold certified)
- Fully dynamic:
- Stack initialization/de-initialization
- Interface up/down
- Resource management
- Module configuration
- Multiple interfaces (Ethernet and WiFi)
- Run-time configuration (console)
- Interrupt driven operation
- RTOS friendly
To view the following video full screen, click on the video title (view on YouTube).
The following third party companies offer MPLAB® Harmony compliant software for TCP/IP applications:
SSL/TLS Library from wolfSSL
CyaSSL is a lightweight C-language-based SSL/TLS library targeted for embedded, RTOS, or resource-constrained environments primarily because of its small size, speed, and portability. CyaSSL supports industry standards up to the current TLS 1.2 and DTLS 1.2 levels. It is up to 20 times smaller than OpenSSL offering a simple API, an OpenSSL compatibility layer, OCSP and CRL, and several progressive ciphers. CyaSSL is under active development, and should be chosen over yaSSL when possible.
- Up to TLS 1.2 and DTLS 1.2
- Full client and server support
- Progressive list of supported ciphers
- Key and Certificate generation
- OCSP, CRL support
- Support Available
- Small Size: 20-100kB
- Runtime Memory: 1-36kB
- 20X smaller than OpenSSL
For more information see wolfSSL's website:
To view the following video full screen, click on the video title (view on YouTube).
Microchip’s MPLAB® Harmony USB software includes royalty-free source code and example projects. It provides support for USB device mode, embedded host and On-The-Go for PIC32 microcontrollers.
USB Device Library
The MPLAB® Harmony USB Device Library (referred to as the USB Device Library) provides embedded application developers with a framework to design and develop a wide variety of USB Devices. A choice of Full Speed only or Full Speed and Hi-Speed USB operations are available, depending on the selected PIC32 microcontroller. The USB Device Library facilitates development of standard USB devices through function drivers that implement standard USB Device class specification. Vendor USB devices can also be implemented via USB Device Layer Endpoint functions. The USB Device Library is modular, thus allowing application developers to readily design composite USB devices. The USB Device Library is a part of the MPLAB Harmony installation and is accompanied by demonstration applications that highlight library usage. These demonstrations can also be modified or updated to build custom applications.
The USB Device Library features the following:
- Support for different USB device classes (CDC, Audio, HID, MSD, and Vendor)
- Supports multiple instances of the same class in a composite device
- Supports multiple configurations at different speeds
- Supports full speed and high speed operation
- Supports multiple USB peripherals (allows multiple device stacks)
- Modular and Layered architecture
- Supports deferred control transfer responses
- Completely non-blocking
- Supports both polled and interrupt operation
- Works readily in an RTOS environment
USB Host Library
The MPLAB® Harmony USB Host Library (referred to as the USB Host Library) provides embedded application developers with a framework to design and develop USB host support for a wide variety of USB device classes. A choice of full speed only or full speed and high speed USB operations are available, depending on the selected PIC32 microcontroller. The USB Host Library facilitates support of standard USB devices through class drivers that implement standard USB device class specification. Support for custom USB devices can also be implemented via a generic class driver. The USB Host Library is modular, thus allowing application developers to readily support composite USB devices. The USB Host Library is a part of the MPLAB Harmony installation and is accompanied by demonstration applications that highlight library usage. These demonstrations can also be modified or updated to build custom applications.
The USB Host Library features the following:
- Class Driver Support (CDC, Audio, HID, MSD and Generic)
- Designed to support USB devices with multiple configurations at different speed
- Supports low speed, full speed and high speed operation.
- Supports multiple USB peripherals (allows multiple host stacks)
- Modular and Layered architecture
- Completely non-blocking
- Supports both polled and interrupt operation.
- Works readily in an RTOS environment.
- Designed to readily integrate with other Harmony Middleware
Microchip provides a complete graphics library that allows you to quickly and easily implement a Graphical User Interface (GUI) on small, color, touch screen displays. The complete graphics display solution enables you to quickly evaluate a graphics display solution at minimal cost.
- Up to 16-bit or 65K colors
- 2D objects such as line, circle, text, rectangle, polygon, bar
- 3D objects such as buttons, panels, window, group box, slider
- Image, animation
- Resistive touch screen, keypad
- Multiple fonts
MPLAB® Harmony Graphics Composer (MHGC)
The MPLAB® Harmony Graphics Composer (MHGC) is a graphical user interface design tool that is integrated as part of the MPLAB Harmony Configurator (MHC). This tool enables you to easily configure and visually design for the MPLAB Harmony Graphics Primitive Library and the MPLAB Harmony Graphics Object Layer.
The Graphics Composer performs the following tasks for you:
- Import image and font assets
- Create screens and schemes
- Add objects to screens
- Configure objects
- Generate MHC configuration
- Upload program to device
MHGC User Interface
For more detail on the MHGC User Interface, please see the MPLAB Harmony Help file. It can be found in the Harmony install folder under the doc folder.
To start the MPLAB Harmony Graphics Composer, in MHC, expand the Harmony Framework Configuration > Graphics Library > Harmony Graphics Library selection tree, and check the Use Graphics Library? box. Click the Execute button.
Graphics Composer Screen
When MHGC is opened, the Graphics Composer Screen is displayed (see the associated image). This screen is the same size and resolution as your actual display, and it simulates how objects will appear on the screen.
Graphics Composer Tool Box
You will find the Graphics Composer Tool Box in the top left pane. It shows the various objects that can be added to the display screen. You will see two types of objects in this window:
- Primitives (basic objects: Line, Rectangle, Circle, Image, Text)
- Widgets (complex objects: Button, Check Box, Progress Bar, Meter, etc…)
Graphics Composer Properties
The Graphics Composer Properties tab is displayed in the right top pane. This allows you to view and edit the properties of the selected screen or object.
Graphics Composer Management
The Graphics Composer Management tab is displayed in the bottom left pane. This has four sub tabs:
The Screens tab lists the screens designed for the application. It has options to create, delete, copy, move up/down and make a screen as primary screen.
The Objects tab lists the objects used in the application. It has multiple options to control how the objects appear on the screen.
The Schemes tab lists the schemes designed for the project. This defines the font size, color, image, texture etc…
The Assets tab lists the graphics resources used by the applications. Assets could be fonts, images or any other data needed by the application.
To view the following video full screen, click on the video title to view it on YouTube.
Harmony MHGC Tutorial
Learn more >
This library provides all of the functionality of the Bluetooth Stack interfaces including profiles and protocols at the lower levels. These are utilized in a number of demonstration applications used in the PIC32 Bluetooth Audio Development Kit. Specific demonstrations to illustrate the various connection options, data and audio communications and control interfaces are available for purchase through Microchip Direct.
The PIC32 Bluetooth SPP-only (Serial Port Profile) Stack Library is created under license from Searan LLC, and uses the dotstack™ framework. This library has been qualified for use and a QDID is available from the Bluetooth SIG. More information about the qualification process can be found in the "PIC32 Bluetooth Audio Development Kit Reference Guide" (DS70005140).
The PIC32 Bluetooth SPP-only Stack Library is available only in binary format. When a license is acquired it may be for SPP (data) only, or with access to SBC or AAC decoders. The different licenses come with a number of specific applications. For more information on the license options please see http://www.microchip.com/pic32btsuites.
The license to the stack must be procured from Microchip, and it is specific to the Microchip PIC32 microcontroller architecture. Some licenses require a one-time fee conveyed when a customer purchases the demonstration applications for the PIC32 Bluetooth Audio Development Kit (P/N DV320032).
There are four potential options in the license:
- SPP (data only) - This is a special version of the library available to carry data only. The decoder options have been removed in this case. The license is available for Microchip PIC® products, but is free of charge. Special demonstrations and the library for this product can be found under the SPP section by visiting http://www.microchip.com/pic32btsuites.
- SBC Decoder - This Bluetooth license also grants the user the ability to use the baseline audio SBC decoder which is provided as a separate library. The demonstrations include stand alone Bluetooth audio streaming using this decoder, and other applications which combine the use of USB and Bluetooth audio.
- AAC Decoder - This Bluetooth license also grants the user the ability to use the audio AAC decoder if a connected device supports this form of streaming. For devices that only support SBC, the SBC decoder is also included. All demonstrations of the (1) license are included. In addition, new demonstrations are included that make specific use of the AAC decoder both with and without USB options.
- Break-in Feature with SBC Decoder - The break-in feature enables multi-connection support and a "Party mode" where multiple handset devices can take turns sharing the Bluetooth connection to stream SBC audio. This also supports the single connection SBC audio streaming in SPP.
All licenses are available through microchipDIRECT. More details on the specific application demonstrations can be found in the "PIC32 Bluetooth Audio Development Kit Reference Guide" (DS70005140).
Microchip offers a reliable security solution for embedded applications on PIC32 devices. The Cryptographic Library includes functions to perform encryption, decryption, hashing, authentication and compression within the embedded application. Random number generation (RNG) functions are also provided.
- Authentication capabilities:
- Cryptographic capabilities:
- 128-, 192-, 256-bit key lengths
- CBC, CTR, GCM, and CCM-8 modes
- DES/Triple DES
- Elliptic Curve Cryptography (ECC)
- Random number capabilities:
- Single random number
- Block of random numbers
- Compression capabilities:
- Huffman encoding
DSP Fixed-Point Math Library
The DSP Fixed-Point Library uses fixed-point fractional functions to optimize execution speed. These functions limit the accuracy of the calculations to the bits specified for the function. Due to parallelism in some operations, the 16-bit version of the functions are more efficient than their 32-bit counterparts. In many cases both 16-bit and 32-bit functions are available to give the user the choice of balance between speed and functional resolution.
A majority of the DSP Fixed-Point Library uses functions with variables in Q15 or Q31 format. This limits the equivalent numerical range to roughly -1.0 to 0.999999999. It is possible to represent other number ranges, but scaling before and after the function call are necessary. All library functions will saturate the output if the value exceeds the maximum or is lower than the minimum allowable value for that resolution. Some pre-scaling may be necessary to prevent unwanted saturation in functions that may otherwise create calculation errors.
The DSP Library supports the following functions:
- Complex Math Functions….General mathematical operations using a complex structure with the form (a + bi)
- Vector Math Functions……..Mathematical operations on a array of numbers or vectors
- Matrix Math Functions……..Mathematical operations on a matrix
- Digital Filter Functions……..FIR and IIR filtering functions with various architectures
- Transform Functions……….FFT, Windows and related transform elements
- Support Functions………….Quick support functions for numerical transform
LibQ Fixed-Point Math Library
The LibQ Fixed-Point Math Library simplifies writing fixed point algorithms, supporting Q15, Q31 and other 16-bit and 32-bit data formats. Using the simple, C callable functions contained in the library, fast fixed point mathematical operations can be easily executed. Fixed-point mathematical calculations may replace some functions implemented in the floating point library (math.h), depending on performance and resolution requirements.
Functions included in the LibQ library include capabilities for trigonometric, power and logarithms, and data conversion. In many cases the functions are identical other than the precision of their operands and the corresponding value that they return.
These functions are implemented in efficient assembly, and generally tuned to optimize performance over code size. In some cases the library breaks out functions that enable one to be optimized for accuracy, while another version is optimized for speed. These functions such as _LIBQ_Q2_29_acos_Q31() and _LIBQ_Q2_29_acos_Q31_Fast() are otherwise identical and can be used interchangeably. Each of these functions are typically used in computationally intensive real-time applications where execution time is a critical parameter.
The LibQ Fixed Point Math Library supports the following functions:
- Square Root
- Random Number