Getting started with Microchip: PIC32MZ-DA

PIC32MZ-DA Evaluation Kit with Multimedia Expansion Board II.

The following article explains all necessary steps to create an Embedded Wizard UI application suitable for the PIC32MZ-DA Evaluation Kit (DM320008 or DM320010) in combination with the Multimedia Expansion Board II (DM320005-5) from Microchip.

Please follow these instructions carefully and step by step in order to ensure that you will get everything up and running on your target. In case you are not familiar with Embedded Wizard, please read first the chapter basic concepts and the Quick Tour tutorial to understand the principles of Embedded Wizard and the GUI development workflow.

First, make sure you have all of the following items:

Hardware components

PIC32MZ-DA Embedded Graphics Starter Kit with Stacked DRAM (DM320010) from Microchip or PIC32MZ-DA Embedded Graphics Starter Kit with External DRAM (DM320008) from Microchip

Multimedia Expansion Board II (DM320005-5) from Microchip

MPLAB ICD 3 In-Circuit Debugger (DV164035) or MPLAB ICD 4 In-Circuit Debugger (DV164045) from Microchip

Software components

Embedded Wizard Studio

You can download Embedded Wizard Studio directly from the following link:

EmbeddedWizard_Studio_x64-V15.00.msi

Customers can also find all their licensed software packages in the Embedded Wizard Download Center (login required).

Embedded Wizard Build Environment for PIC32MZ-DA-MEB-II

You can download the suitable Build Environment from the following link:

PIC32MZ-DA-MEB-II-BuildEnvironment-V15.00.00.00.zip

Customers can also find the latest version of the Build Environment and their licensed Platform Package source codes in the Embedded Wizard Download Center (login required).

MPLAB-X IDE version 5.40 for Windows

MPLAB Harmony Integrated Software Framework v2.06 for Windows

MPLAB XC32/32++ Compiler v2.30 for Windows

Installing Tools and Software

IMPORTANT

The Build Environment for PIC32MZ-DA-MEB-II supports only the supports only the PIC32MZ-DA hardware configurations as described above. Other hardware and display combinations of the evaluation board are not tested.

Step 1: Install the latest version of Embedded Wizard Studio.

Step 2: Install the Microchip tools: MPLAB-X IDE, Harmony and XC32 Compiler.

Step 3: Unpack the provided Embedded Wizard Build Environment for PIC32MZ-DA-MEB-II to your local file system (e.g. C:\Microchip[.]).

Exploring the Build Environment

The provided Embedded Wizard build environment for PIC32MZ-DA-MEB-II contains everything you need to create, compile, link and flash an Embedded Wizard UI application for the PIC32MZ-DA-MEB-II target. After unpacking, you will find the following subdirectories and files:

StartGccBuildEnvironment_DAG169.bat / StartGccBuildEnvironment_DAA288.bat - These script files are provided to start a windows command line to build your GUI applications suitable for the desired target.

\Application - This folder contains ready-to-use projects to compile and link an Embedded Wizard generated UI application. They are used for all provided examples and they can be used to build your own UI applications.

\GeneratedCode - This folder is used to receive the generated code from an Embedded Wizard UI project. All template projects are building the UI application out of this folder. You can create your own UI project and generate the code into the subdirectory \GeneratedCode without the need to adapt the project.

\Project - This folder contains the prepared projects for GCC (make) and MPLAB-X.

\Source - This folder contains the files main.c and ewmain.c. There you will find the initialization of the system and the main loop to drive an Embedded Wizard GUI application. The file ewconfig.h contains general configuration settings for the target system, like memory ranges and display parameter and configuration settings for the Embedded Wizard Graphics Engine and Runtime Environment. Additionally, this folder contains the device driver C/H files used for the DeviceIntegration example.

\Examples\<ScreenSize> - This folder contains a set of demo applications prepared for a dedicated screen size (480x270 pixel). Each example is stored in a separate folder containing the entire Embedded Wizard UI project. Every project contains the necessary profile settings for the PIC32MZ-DA-MEB-II target. For a complete overview and detailed descriptions of all available examples, including their features and usage, see Examples.

\PlatformPackage - This folder contains the necessary source codes and/or libraries of the PIC32 Platform Package: Several Graphics Engines for the different color formats (RGBA8888, RGB565, Index8 and LumA44) and the Runtime Environment (in the subdirectory \RTE).

\TargetSpecific - This folder contains all configuration files and platform specific source codes. The different ew_bsp_xxx files implement the bridge between the Embedded Wizard UI application and the underlying board support package (Microchip hardware drivers) in order to access the display, the serial interface and the clock.

\ThirdParty - This folder contains third-party source codes and tools:

\Make - This folder contains a make tool to build the entire GUI application via command line.

Creating the UI Examples

For the first bring up of your system, we recommend to use the example 'HelloWorld':

Example 'HelloWorld' within Embedded Wizard Studio.

The following steps are necessary to generate the source code of this sample application:

Navigate to the directory \Examples\<ScreenSize>\HelloWorld.

Open the project file HelloWorld.ewp with your previously installed Embedded Wizard Studio. The entire project is well documented inline. You can run the UI application within the Prototyper by pressing Ctrl+F5.

To start the code generator, select the menu items BuildBuild this profile - or simply press F8. Embedded Wizard Studio generates now the sources files of the example project into the directory \Application\GeneratedCode.

Compiling, Linking and Flashing

The following steps are necessary to build and flash the Embedded Wizard UI sample application using the GCC ARM embedded toolchain:

Navigate to the top level of the Build Environment.

If your are using the PIC32MZ-DA Embedded Graphics Starter Kit with Stacked DRAM (DM320010), then start the file StartGccBuildEnvironment_DAA288.bat. If you are using the PIC32MZ-DA Embedded Graphics Starter Kit with External DRAM (DM320008), then start the file StartGccBuildEnvironment_DAG169.bat. In both cases, a windows command line window should open. In case there are error messages, please edit the file and double-check the path settings.

Now start compiling, linking and flashing:

make make install

If everything works as expected, the application is now executed on your PIC32MZ-DA-MEB-II target.

Example 'HelloWorld' running on PIC32MZ-DA-MEB-II development board.

All other examples can be created in the same way: Just open the desired example with Embedded Wizard Studio, generate code and rebuild the whole application using simply:

make install

Creating your own UI Applications

In order to create your own UI project suitable for the PIC32MZ-DA-MEB-II target, you can create a new project and select the PIC32MZ-DA-MEB-II project template:

As a result you get a new Embedded Wizard project, that contains the necessary Profile attributes suitable for the PIC32MZ-DA-MEB-II development board:

The following profile settings are important for your target:

The attribute PlatformPackage should refer to the PIC32 Platform Package.

The attribute ScreenSize should correspond to the display size of the PIC32MZ-DA-MEB-II development board.

The attributes ModeOfBitmapResources and ModeOfStringConstants can be set to DirectAccess in case that the resources should be taken directly from flash memory. By default these attributes are set to Compressed.

The attribute OutputDirectory should refer to the \Application\GeneratedCode directory within your Build Environment. By using this template, it will be very easy to build the UI project for your target.

The attribute CleanOutputDirectories should be set to true to ensure that unused source code within the output directory \Application\GeneratedCode will be deleted.

The attribute PostProcess should refer to \Application\Project\MPLAB\EmbeddedWizard_PostProcess\MPLAB_ew_post_process.cmd if you are working with MPLAB-X. In case of the GCC ARM embedded toolchain leave it blank

Now you can use the template project in the same manner as it was used for the provided examples to compile, link and flash the binary.

After generating code, please follow these steps, in order to build your own UI application:

Depending on your hardware, start the batch file StartGccBuildEnvironment_DAG169.bat or StartGccBuildEnvironment_DAA288.bat. Again, a windows command line window should open.

Start compiling, linking and flashing:

make install

Most of the project settings are taken directly out of the generated code, like the color format or the screen orientation. All other settings can be made directly within the file ewconfig.h, which contains general configuration settings for the target system.

Console output

In order to receive error messages or to display simple debug or trace messages from your Embedded Wizard UI application, a serial terminal like 'Putty' or 'TeraTerm' should be used.

As soon as you connect your PIC32MZ-DA-MEB-II target with the PC via USB, a new virtual Com Port appears within your system device list. Open the device manager to get the port number of this COM port. The USB port on the PIC32MZ-DA-MEB-II board is signed as UART USB

Now you can open your terminal application and connect it via COMx with the following settings: 115200-8-N-1

During a successful application startup, the console displays the following information:

Initialize Display... [OK] Initialize Touch Driver... [OK] Initialize Memory Manager... [OK] Initialize Platform Package... [OK] Initialize Invocation Queue... [OK] Create Embedded Wizard Root Object... [OK] Create Embedded Wizard Viewport... [OK] --------------------------------------------- Embedded Wizard System Info --------------------------------------------- Target system PIC32MZ-DA-MEB-II Color format RGBA8888 Build Environment version V15.00.00.00 Runtime Environment (RTE) version V15.00 Graphics Engine (GFX) version V15.00 MemoryPool address 0xA84E4800 MemoryPool size 4194304 bytes Framebuffer address 0xA8000000 Doublebuffer address 0xA8465000 Display size 480 x 272 Framebuffer size 480 x 272 Surface rotation 0 EwScreenSize 480 x 272 Graphics accelerator Nano2D Warp function support enabled Vector graphics support enabled Gradients support enabled Blur support enabled Mask support enabled Tint support enabled Bidirectional text support enabled Compression support enabled Index8 bitmap resource support enabled RGB565 bitmap resource support enabled Native bitmap resource support enabled Max surface cache size 2097152 bytes Glyph cache size 256 x 256 Max issue tasks 100 External Flash memory disabled Operating system bare-metal Toolchain GCC C-Compiler version 4.8.3 Build date and time Dec 4 2025, 10:15:46 ---------------------------------------------

This terminal connection can be used for all trace statements from your Embedded Wizard UI applications or for all debug messages from your C code.

Using Microchip MPLAB-X

If you want to use the Microchip MPLAB-X instead of the GCC ARM embedded toolchain, please follow these instructions:

Generating Code with Embedded Wizard Studio:

Open the desired Embedded Wizard example project. All Embedded Wizard examples will store the generated code within the common /Application/GeneratedCode folder.

Select the Profile and set the attribute PostProcess to the file ..\..\..\Application\Project\MPLAB\EmbeddedWizard_PostProcess\MPLAB_ew_post_process.cmd.

To start the code generator, select the menu items BuildBuild this profile - or simply press F8. Embedded Wizard Studio generates now the sources files of the example project into the directory \Application\GeneratedCode. After the Embedded Wizard code generation the installed post process will adapt the MPLAB-X project.

Please assure, that the right version of the Harmony Configurator plug-in is installed:

Open the plug-in window via menu ToolsPluginsInstalled.

Check for MPLAB Harmony Configurator. If Harmony Configurator V2.06 is not installed, please change to DownloadedAdd Plugins ... and select com-microchip-mplab-modules-mhc.nbm below /utilities/mhc of your Harmony 2.06 installation.

Since there is is a path length issue with MPLABX IDE, it is recommended to unpack the complete PIC32MZ-DA-MEB-II Build Environment to a short path position (e. g. below C:\Microchip). Alternatively, a symbolic link can be added on this position using Windows administrator console and mklink /D.

Compiling, linking and downloading:

Open the MPLAB-X template project from the folder \Application\Project\MPLAB. It is commonly used for all provided Embedded Wizard examples.

Set the EmbeddedWizard-PIC32MZ-DA-MEB-II project as main project.

To adapt the project to your local harmony path, open the Harmony Configurator (ToolsEmbedded). Open the configuration, save it and and press the Generate Code button. After the Generate Project dialog opens, press the Generate button and accept all changes by pressing the Close button several times.

Select the right project configuration according to your PIC32MZ DA hardware configuration.

Build the project using Clean and build and download it to your target platform.

TIP

If the Embedded Wizard PostProcess is executed while the MPLABX project is opened in MPLABX IDE, the MPLAB project view will NOT be updated automatically.

Anyway, if using Clean and build, the updated project setting will be used.

Alternatively, please close the MPLABX project before rebuilding the Embedded Wizard project and re-open it afterwards.

Release notes

The following section contains the version history of the Build Environment (including Graphics Engine and Runtime Environment) for PIC32MZ-DA-MEB-II. These release notes describe only the platform specific aspects - for all general improvements and enhancements please see the Embedded Wizard release notes.

Version 15.00.00.00

Using Graphics Engine (GFX) and Runtime Environment (RTE) V15.00.