Creating a New MLA Graphics Project
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.
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.
Test the Project on Your Development Board
From MPLAB X IDE, 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 C/C++ Compiler or MPLAB XC16 C Compiler), 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 IDE 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.
Set Up the Programmer and Compiler Version
- Select the Make and Program Device button from the main MPLAB X IDE 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.
"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.
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:
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.