Creating a New Graphics Project

This page contains information for the Graphics Library found in the Microchip Libraries for Applications (MLA). It is not relevant for the MPLAB® Harmony Graphics Library.

Methodology

This page shows how to copy an existing MLA graphics project. After creating the new project, the developer can modify the code to meet the application needs. The method of copying/modifying a working project is a simple and easy-to-understand approach to graphics project creation. This approach is less prone to error and easily accomplished by someone new to MLA graphics.

There are other methods of creating graphics projects such as using the Graphics Display Designer (GDD-X) tool or creating a project from scratch. To effectively use the GDD-X, many of the concepts yet to be presented in the tutorial need to be understood. It is recommended that after completing this tutorial, the student use GDD to create an MLA graphics application project.

1 Identify a Project to Copy

There are several projects in the MLA graphics directory. Each project demonstrates how to implement some unique features of the MLA. To demonstrate these features, certain files and project settings were configured in the projects by experienced Microchip engineers. By copying a project which includes the features you are most interested in using, you will not have to go through a possibly complex project setup procedure. Experience has shown this is a superior approach for customers new to the graphics MLA.

This example below shows how to copy the project app_notes project.

2 Test the Project on Your Development Board

From MPLAB X, the app_notes project can be run by opening the project:
<installation directory>/apps/gfx/app_note/firmware/app_notes.X

Before attempting to run the project, MPLAB X IDE, a compiler ( MPLAB XC32 or MPLAB X XC16), and the MLA must be installed. A development board with an MLA supported display and a programmer/debugger will also be needed.

Open the Project

  • Select the Open Project button
  • Browse to: /apps/gfx/app_notes/firmware located in the MLA installation directory
  • Open the project by selecting app_notes.X
  • Then select Open Project

Set the Project Configuration

MLA projects have one configuration for each supported development board. To set a configuration as active, use the pull-down menu in the MPLAB X toolbar.

In this example, the project uses the PIC24FJ256DA210 development board connected to a QVGA display. Using a combination of the horizontal and vertical scroll bars on the pull-down menu, you will be able to locate the configuration for your particular development setup.

Set Up the Programmer and Compiler Version

Examine the Project Properties to verify two items. Verify the compiler and version specified for the project match the compiler and version installed. Verify the programmer/debugger connected to the computer is the one called for in the project properties.

Make all necessary changes to the project properties for the project, the compiler, and the programmer/debugger.

Run the Program on Your Hardware

Select the Make and Program Device button form the main MPLAB X toolbar. The project will build, connect to the programmer/debugger, program the device on the development board, then release the MCLR line. The application will begin to run, displaying a series of images on the screen.

The app notes project utilizes the resistive touch screen of the display. By following the directions on the screen, you can work through the demo and observe a handful of the graphics capabilities available.

The first time a development board runs an MLA Graphics project utilizing a touch screen, a special calibration routine may be run to make sure the system can properly detect the location of touches. The calibration routine places some arrows on the screen and asks you to touch them. Upon the completion, the calibration routine will pass control on to the Object Layer Demo.

3 "Package" the Project Files

Rather than recreate the project structure and copy individual files, use the IDE's Package utility to create a copy of the project. Packaging a project creates a ZIP file containing all the project files and directories. When unzipped, you can begin developing code within the new project.

4 Adjust the Project Settings

  • Once the new project has been copied, re-verify the Project Properties are set for the installed compiler version and programmer/debugger. This step uses the identical procedures to the ones used on the original MLA project.
  • The next step is to remove all the unused configurations from the project. Having a significant number of unused configurations in a project can slow down the ability of MPLAB X to parse and scan the project, this can slow down the IDE's response to some user commands.
  • To remove unused configurations, select the Manage Configurations button from the Project Properties pane.
  • A box will appear listing all the configurations for the current project. By selecting the Remove button you can delete the highlighted configuration. Care should be taken not to delete the active configuration. The current active configuration is marked with the word Active.
  • At the end of the process, only the Active configuration should remain.
  • Before you test your project you may wish to rename this new project to a name other than what the MLA project is called. To do this, right click on the project name in the Project Page. When the list of options appears, select Rename…. Follow the instructions to complete renaming the project:

5 Test the New Project

After the MCU, compiler, programmer/debugger, and the configuration has been set on the new project, you are ready to verify that the project runs. To test the project, click the Make and Program Device button. The new project will build, connect to your programmer/debugger, and program the device. When the device has been programmed, the MCLR line will be released and the new application will run just as the original MLA project ran.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.