PIC32MZ DA User Guide for Microchip Graphics Suite (MGS) Harmony
Introduction
The PIC32MZ DA is a family of microcontrollers based on the MIPS32® microAptiv™ core that are notable for their integrated graphics capabilities, which include a Graphics Processing Unit (GPU) and a Display Controller. This makes them particularly suitable for applications that require rich graphical user interfaces, such as home automation systems, industrial control panels, and medical devices.
Getting Started
Development Kit
The PIC32MZ DA Curiosity Development Kit and displays are supported in Microchip Graphics Suite (MGS) Harmony.
You will find more information about these kits on the pages listed in the table:
Development Boards | Supported Displays |
Hardware Setup
The PIC32MZ DA Curiosity Development Kit comes with the 24-bit passthrough graphics card. This graphics card can be used to connect either the 4.3" WQVGA or the 5" WVGA displays.
To connect the display to the development board:
Disconnect the flat cable from the J2 connector on the MEB adapter board.
Connect the free end of the cable to the 24-bit passthrough graphics card as shown.
Application Examples
Use the application Quickstart examples to start developing an embedded Graphical User Interface (GUI) project on the PIC32MZ DA Curiosity Development Kit. These examples are published on the GFX applications Github repository.
Use the MPLAB® Code Configurator (MCC) Content Manager to download these examples or clone/download directly from the GitHub repository
Legato Quickstart Applications
Legato Quickstart provides a good starting point for GUI development with MGS Harmony Graphics.
To get started, build and program the appropriate Legato Quickstart project based on the display module being used and the preferred color mode. Refer to the application documentation for details on how to run it.
Display Module | MGS Harmony Graphics |
---|---|
High-Performance 4.3" WQVGA Display Module with maXTouch Technology (AC320005-4) | |
High-Performance 5" WVGA LCD Display Module with maXTouch Technology (AC320005-5) |
Project Configuration
Here's a typical project graph for a PIC32MZ DA MGS Harmony project.
Display Components
Display Module
The Display Module component provides display-specific information like resolution and display timing.
For PIC32MZ DA Development Kits, examples of Display Module components are the PDATM5000, PDA TM4301 for the 5.0 WVGA and the 4.3" WQVGA displays.
GFX Core LE
GFX Core LE shows the display information provided by the Display Module in the project graph.
This timing information will be generated in the GLCD display controller driver to configure the GLCD peripheral.
LE GLCD
The GLCD component provides configuration options for the GLCD display controller driver.
Clock Settings | |
Pixel Clock Divider | Sets the GLCD clock divider to change the pixel clock frequency. |
Layer Configuration | |
Enable Advanced Layer Configuration | Enables per-layer configuration like position, size, color mode, etc. |
Enable Layers | Enables the HW layers in the GLCD. |
By default, all the layers will be configured to the same resolution, position, and frame buffer color mode.
If each layer needs to be configured differently, enabling Advanced Layer Configuration will allow user-specified size, position, frame buffer color mode, and base addresses. Base addresses are set using the KSEG1 (non-cacheable) address.
Frame Buffer Settings | |
Frame Buffer Color Mode | Sets the default color mode for the frame buffers for all the GLCD HW layers, if advanced layer configuration is not enabled. |
Use Double Buffering | Enables double buffering which can help avoid screen tearing. |
Frame Buffer Memory Mode | Sets the RAM used to store the frame buffers. |
Use 8-bit Palette? | Configures the GLCD layers to LUT8 mode. LUT8 mode uses a global color palette to reduce frame buffer size. Refer to Legato Climate Control application for an example. |
Other Settings | |
Update On VBlank | When checked, the GLCD driver will configure the GLCD registers only during the VBLANK period. This avoids display glitches when configuring the GLCD at run-time. |
Canvas Mode | This needs to be checked if using the GFX Canvas. |
Use GPU for Blits | When checked, the GLCD driver will use the GPU to copy the scratch buffer to the frame buffer. Using the GPU can accelerate frame buffer updates. |
Blit on VBlank | When checked GPU scratch buffer blits will be performed during the VBLANK period. |
GPU Component
LE 2DGPU
The LE 2D GPU component enables the 2D GPU (Nano2D). The 2D GPU can be used to accelerate certain graphics functions like fills, scratch buffer copy, and advanced functions like pre-processed image blits.
Designing the GUI with MGS Harmony
To start designing the GUI on the PIC32MZ DA development kits, it is recommended that the Legato Quickstart application be used as the starting project.
Refer to the MGS Harmony User Guide for information on how to use the MGS Composer and MGS Harmony Widgets to design the GUI.
Optimizing the GUI Design
For general guidelines on how to optimize the GUI design for improved performance or memory/flash usage refer to this "Optimizing a Microchip Graphics Suite (MGS) Harmony Project" page.
For advanced usage and optimization on the PIC32MZ DA, check out the "PIC32MZ DA User Guide for Microchip Graphics Suite (MGS) Harmony" page.
How-To Guides
Image Preprocessing
Image processing is a feature in MGS Harmony that facilitates the efficient storage of compressed images in flash memory, which are subsequently decompressed to Random Access Memory (RAM) upon system startup.
On the PIC32MZ DA, compressed images in flash can be pre-decoded to the integrated DRAM for faster rendering.
Use Layers and HW Overlays
Using layers to separate UI components uses the HW overlay features of the PIC32MZ DA's integrated display controller and enables users to design complex GUIs and UI functions while minimizing the processing load on the main CPU.
Use the Graphics Canvas
The Graphics Canvas is a middleware in MGS that enables users to easily leverage the HW features of the integrated display controllers in Microchip's graphics-enabled MCUs and MPUs. These features can be used to perform complex GUI effects without loading the CPU, including effects like sliding, fading, screen pre-rendering, and sprite animations.
Application Example | Description |
Legato Dashboard | This demo uses the Graphics Canvas to show sliding screens and rotating gauge needles. |
Legato Climate Control | This demo uses the Graphics Canvas to show multi-layer WVGA graphics using internal SRAM only without the need for DDR memory. The library uses 8-bit index frame data to draw on a scratch buffer in internal SRAM. |
Use External Flash Memory
External flash memory like QSPI, NOR, and SQI™ flash can be used to store graphics assets like images and fonts. These are useful when using large amounts of images or multi-language fonts. Refer to the following example applications on how to configure an MGS Harmony project with external resources.
Application Example | Description |
Legato External Resources | This project showcases how the MGS Harmony can be used to package images and font glyphs to be stored in external non-volatile memory, specifically a QSPI, NOR, and SQI™ flash. |
Legato Quickstart External Resources | This demonstration shows how to use the Legato Graphics Library to retrieve externally stored assets. |
Control the display backlight
The PIC32MZ DA can be used to control the display backlight, enabling features like display fade in/out, dimming for power save mode, etc.
On the PIC32MZ DA Curiosity board, the display backlight can be controlled by using the OCMP1 and TMR2 peripherals to generate the PWM backlight signal.
The OCMP1 and TMR2 components are added and configured in the MCC Harmony project as follows.
In the MCC Harmony Pin Settings, pin RD0 is set to OC1 function to generate the Pulse-Width Modulation (PWM) backlight signal to the display.
The PWM duty cycle is set by calling the OCMP1_CompareSecondaryValueSet() peripheral library API.
For project examples and code usage, check out the Legato Dashboard and Legato Climate Control applications.
Use a Third-party Display
Third-party displays may be used with the PIC32MZ DA Curiosity Development board using the GFX Proto board for Curiosity (EV48R50A). The GFX Proto board enables users to solder the appropriate cable connector for the display and route the display signals to the PIC32MZ DA Curiosity board. Refer to the "Graphics Prototype Board for Curiosity Boards User Guide" for more information.
For instructions on how to adjust the display timing, refer to "Microchip Graphics Suite (MGS) Display Timing Guide".
Troubleshooting Guide
Issue | Things to check |
---|---|
Blank display |
|
Screen corruption when updating |
|